mythril-hypervisor / mythril

A hypervisor written in rust
MIT License
56 stars 15 forks source link

acpi: RSDP is not found when on Ubuntu 18.04 #58

Open dlrobertson opened 4 years ago

dlrobertson commented 4 years ago

Summary

When running make qemu from a Ubuntu 18.04 host we fail to find the RSDP.

  [   0.000000] MYTHRIL-INFO: tsc calibrate diff=5493740 (khz=3200699)
  [   0.000001] MYTHRIL-INFO: Allocating from 0x3320ecd-3ffe0000
  [   0.000528] MYTHRIL-ERROR: Panic in mythril_multiboot2/src/main.rs at (241, 16):
  [   0.001074] MYTHRIL-ERROR: Failed to find the RSDP: NotFound

CC: @barkera @ntegan @sruffell

ntegan commented 4 years ago

Is found, however, via the multiboot crate BootInformation as in

https://github.com/mythril-hypervisor/mythril/pull/56

ALSchwalm commented 4 years ago

Bizarrely I can't reproduce this under docker at all. Using the 18.04 container (grub-mkrescue (GRUB) 2.02-2ubuntu8.15 and QEMU emulator version 2.11.1(Debian 1:2.11+dfsg-1ubuntu7.26)), things seem to work as expected. I suppose that pretty much narrows it down to a kvm issue in whatever kernel ubuntu 18.04 uses.

ALSchwalm commented 4 years ago

Anybody have a 18.10 ubuntu box to test on? This isn't that shocking now that I think about it. Nested virtualization was probably not super functional back then.

dlrobertson commented 4 years ago

Bizarrely I can't reproduce this under docker at all.

Sanity check: was this pre https://github.com/mythril-hypervisor/mythril/commit/36bb1e165b257e70ae5ae4ddf5d7b24e33a09f07 ?

Anybody have a 18.10 ubuntu box to test on?

Installing it on an old laptop now.

ALSchwalm commented 4 years ago

Correct, this was before the multiboot stuff

dlrobertson commented 4 years ago

I suppose that pretty much narrows it down to a kvm issue in whatever kernel ubuntu 18.04 uses.

Can confirm. We find the RSDP when we disable kvm on a Ubuntu 18.04 box. When dumping memory in gdb, it seems that the main bios area is zeroed out.

ALSchwalm commented 4 years ago

Ah, we can test that because we don't need kvm for the nested virt until we actually go vtx-on. Clever. Well I guess now we just need to determine when they fixed that and document the earliest supported kernel version for testing.

ntegan commented 4 years ago

I could do some brute force searching of which kernels work, once I finish the other issue i'm working on.

unless you guys get to it first

ALSchwalm commented 4 years ago

Honestly I really just want to know if it works in 18.10. That would be sufficient for a minimum viable platform kind of thing.

I'd really like to spin up a test platform at some point, though I'm not sure how we would actually integrate it in to the current CI approach. Moving the project to gitlab might make sense.

dlrobertson commented 4 years ago

Honestly I really just want to know if it works in 18.10. That would be sufficient for a minimum viable platform kind of thing.

Would the work to use the multiboot info satisfy this?

dlrobertson commented 4 years ago

I don't hit this issue when I force the RSDP search on ubuntu 20.04.

dlrobertson commented 3 years ago

Is this issue still hit? I don't think we should hit this any more now that we also look in the multiboot info