-
Notifications
You must be signed in to change notification settings - Fork 933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to chainboot from network with SecureBoot enabled #8770
Comments
Does starting a normal LXD Ubuntu VM outside of MAAS with secureboot enabled works for you? If so, you should look at edibootmgr and the files in /boot/efi to see what differs. |
I just validated that a hirsute system with:
Boots without any issue here. |
Trying to use those binaries through MAAS here, I always get to a grub prompt, manually running Post install, I'm seeing a hang at:
Then looking at qemu's log, we're seeing a qemu/kvm crash:
|
Manually booting the VM works fine (ESC to enter firmware, use boot menu and select the ubuntu entry). |
@ltrager were you testing with the latest edk2? LXD uses 2021.02 which roughly matches what's in impish. You running an older edk2 may explain a difference in behavior. |
The concern about To answer your question my libvirt testing was done on Ubuntu 20.10 using packages from main and updates. ovmf - 2020.05-5ubuntu0.2 |
Given Ubuntu 21.04 as deployed by MAAS boots just fine when you ask the firmware to directly boot from the It'd be good for you to test with ovmf 2021.02 so we're dealing with a closer comparison. You also should be testing with virtio-net and not e1000e so that the firmware deals with the same network card in both cases. |
As suggested I installed Ubuntu 21.10 Impish with ovmf 2021.02-1, qemu 1:5.2+dfsg-9ubuntu3, and libvirt 7.0.0-2ubuntu2 and created a VM using virtio net and virtio storage. MAAS is able to deploy Ubuntu with SecureBoot enabled. There are no problems chainloading while keeping the chain of trust. Is there an easy way to test Dimitri's theory that |
Sure if that makes you feel better...
|
So this obviously has absolutely nothing to do with no-reboot. |
Using good old print debugging, I've narrowed this down to the kernel calling |
Here's the OVMF debug output leading up to it the crash:
|
Ok, so at least it's a firmware call that crashes everything, so slightly less concerning than just the kernel doing it during normal initialization. Is there any way to get debugging on the firmware side when it handles ExitBootServices? Given it only happens on first boot (or at least looked that way here) and that's when we setup the boot NVRAM entries, I suspect it's got something to do with ExitBootServices applying the variable restrictions (so you can't write to the firmware-only ones)? |
I'm hoping to learn more tomorrow by attaching |
I hooked up Since the address to the invalid instruction always seems to be the same (
GRUB debug tells me it loaded the kernel at nearby/lower address:
So it seems plausible that we're still executing somewhere in the stub. And the instruction before the return address in the stack
I can find this same code in the disassembly of the EFI stub:
And finally, I was able to locate the same code in the disassembly of the |
Here's the disassembly of
|
@sforshee and I were able to make a bit more progress. We found that the crash is occuring because the
@sforshee suggested the following patch to shim:
This does prevent shim from clearing
|
Turns out that was my fault - I had sprinkled |
PR for shim: rhboot/shim#378 |
Closing this one on our side as we've now confirmed the issue is coming from the shim and not from anything LXD is doing (other than us using UEFI+SB by default). |
Required information
Issue description
Machines configured for use with MAAS always boot over the network. When an operating system is deployed MAAS provides a grub.cfg which finds the local bootloader and chainloads it. Previously this caused compatibility issues which caused the chain of trust to be broken. These issues have been fixed in Ubuntu and upstream.
While I have been able to verify SecureBoot is now working with MAAS on physical hardware and libvirt VMs it is still failing with LXD. VMs in LXD either hang or drop to the GRUB shell. We believe this may be due to LXD passing the
-no-reboot
option to qemu.Steps to reproduce
/var/lib/maas/boot-resources/current
or/var/snap/maas/common/maas/boot-resources/current
replacebootx64.efi
with the latest SHIM from shim-signed_1.47+15.4-0ubuntu2_amd64.deb and replacegrubx64.efi
with the latest GRUB from grub-efi-amd64-signed_1.169+2.04-1ubuntu45_amd64.deb"security.secureboot": "true"
Information to attach
LXD qemu command:
libvirt qemu command:
The text was updated successfully, but these errors were encountered: