-
Notifications
You must be signed in to change notification settings - Fork 300
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
Bootloader has not verified loaded image error #138
Comments
I was wondering of the same. I found these comments helpful: #172 (comment) and #172 (comment). There is talk about patched GRUB and "linuxefi" commands various places (like in the comments above). But GRUB master branch now has support for the shim lock protocol built into the normal "linux" command. (I've verified this myself, with grub-2.04-rc1. Remember to enable the shim_lock module.) I guess the question is, would it be a good idea to extend the Linux EFI STUB code with support for the shim lock protocol? |
I used master-sb branch with HEAD c6a389813f715818c942c6b612494cba8e5fa320 pulled today Aug-19 2020. I am using this GRUB with OVMF and Rhboot Shim. I have the following GRUB config :
I have intentionally not provided any initrd or rootfs disk, because i am just testing the secure loading of the kernel. For me this still fails and gives the error "Bootloader has not verified loaded image." Here is some portion of the logs :
The logs clearly says the it requested SHIM to verify and the shim passed the verification as successful, still it says "system compromised" and "bootloader has not verified loaded image". What am I missing here? Why this error? Any hint or guidance is really appreciated. |
You are using multiple UEFI shims in a chained together as part of the boot process, right? I think you might be running into the problem where the I've seen similar problems when chaining shims together for development purposes: the last shim's |
@pcmoore I can't prove that it's not a configuration issue on my end, as I don't know how to use QEMU, but I think that it might be possible to encounter the problem when using only one instance of Shim. I'm currently using |
Hi @Neightro. If you've enrolled the second shim's hash in the MOK and used that for authorization I would expect everything to work as expected since shims static EFI_STATUS EFIAPI
exit_boot_services(EFI_HANDLE image_key, UINTN map_key)
{
if (loader_is_participating ||
verification_method == VERIFIED_BY_HASH) {
unhook_system_services();
EFI_STATUS efi_status;
efi_status = gBS->ExitBootServices(image_key, map_key);
if (EFI_ERROR(efi_status))
hook_system_services(systab);
return efi_status;
}
... |
@pcmoore I was using only one SHIM. |
@pcmoore I'm only running one instance of Shim as well. I run it directly as a BIOS entry, and it runs GRUB just fine. I get the 'bootloader has not verified image' error as soon as I try to run my Linux kernel. If it helps anyone, I can post more detail about my setup, such as snippets of my GRUB config; just say the word! This is nowhere near my area of expertise, so I don't have any intuition of my one as to what would be useful. |
Hi @codernavi18 and @Neightro. Are both of you running GRUB binaries which are known to work with UEFI secure boot and shim? I'm far from an expert on shim, but I have been playing with it a lot lately and in all the cases where the Linux Kernel failed during boot is when it called into the EFI I don't know if it would help at all, but I've got a mostly-automated UEFI Secure Boot dev/test environment (using QEMU+OVMF+swtpm) which I've been using for my shim work and it boots Linux distros just fine. I can add a README and post that if you like. |
Hi,
I was playing with https://github.com/ipxe/shimdemo and tried to load a linux kernel without to interfere with the build in machine's UEFI Secure Boot Keys (PK,KEK,DB).
The boot chain looks like this:
shim.ms.efi
->shim.vendor1.efi
with VENDOR_CERT_FILE=vendor2.der ->ipxe.vendor2.efi
->vmlinuz.vendor2
The Trust chain looks like this:
shim.ms.efi
boots because the MS keys are embedded in the UEFI firmwareshim.vendor1.efi
boots because I added the vendor1.esl to theMokLis
ipxe.vendor2.efi
boots because I added thevendor2.der
insideshim.vendor1.efi
vmlinuz.vendor2
is not booting because of the errorBootloader has not verified loaded image
But if I boot for example a vendor2 key signed
shell.vendor2.efi
instead ofvmlinuz.vendor2
there is noBootloader has not verified loaded image
error and I'm successfully booted a vendor2 signed UEFI shell.Is this the desired behavior?
The text was updated successfully, but these errors were encountered: