Grub2 fails on ASUS X201E with secure boot is enabled

Bug #1187233 reported by Franz Hsieh
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
OEM Priority Project
Fix Released
High
Ara Pulido
Precise
Fix Released
Undecided
Unassigned
grub
New
Undecided
Unassigned
shim (Ubuntu)
Fix Released
Undecided
Steve Langasek
Precise
Fix Released
Undecided
Unassigned

Bug Description

Summery:
  I downloaded images from ubuntu.com and use usb-creator-gtk to create bootable usb.
  Then use the usb key to boot on my ASUS X201E laptop and it is always failed to boot to OS.

  These images are all failed:
    ubuntu-12.04.2-desktop-amd64.iso
    ubuntu-12.10-desktop-amd64.iso
    ubuntu-13.04-desktop-amd64.iso

  I also enabled grub2 debug message, and found they all fail on:
    loader/i386/efi/linux.c:69: Asking shim to verify kernel signature.

  The BIOS revision of ASUS X201E is 209 which can be downloaded from official ASUS website.

  Additionally, Win8 and Fedora-18 can be booted and installed on this platform.

Changed in oem-priority:
importance: Undecided → Critical
Colin Watson (cjwatson)
affects: grub2 (Ubuntu) → shim (Ubuntu)
Ara Pulido (ara)
Changed in shim (Ubuntu):
assignee: nobody → Brian Murray (brian-murray)
Revision history for this message
Ivan Hu (ivan.hu) wrote :

Get log with grub, set debug=all

and it stop at ,

...
loader/i386/efi/linux.c:60: Locating shim protocol
loader/i386/efi/linux.c:69: Asking shim to verify kernel signature
_

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in shim (Ubuntu):
status: New → Confirmed
Steve Langasek (vorlon)
Changed in shim (Ubuntu):
assignee: Brian Murray (brian-murray) → Steve Langasek (vorlon)
Changed in oem-priority:
assignee: nobody → James M. Leddy (jm-leddy)
Ara Pulido (ara)
Changed in oem-priority:
status: New → Confirmed
Revision history for this message
Pander (pander) wrote :
Revision history for this message
Ivan Hu (ivan.hu) wrote :

It seems,
The shim installs the UEFI protocol in shim.c
EFI_STATUS efi_main (EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *passed_systab)
{
        ...
 shim_lock_interface.Verify = shim_verify;

        ...
 uefi_call_wrapper(BS->InstallProtocolInterface, 4, &handle,
     &shim_lock_guid, EFI_NATIVE_INTERFACE,
     &shim_lock_interface);
}

And the grub used the protocol to very the signature, but stopped in the second call.
in grub loader/i386/efi/linux.c
if (shim_lock->verify(data, size) == GRUB_EFI_SUCCESS)
    return 1;
  grub_dprintf ("linuxefi", "Asking shim to verify kernel signature\n");
  status = shim_lock->verify(data, size);
  if (status == GRUB_EFI_SUCCESS)
    {
      grub_dprintf ("linuxefi", "Kernel signature verification passed\n");
      return 1;
    }

  grub_dprintf ("linuxefi", "Kernel signature verification failed (0x%lx)\n",
  (unsigned long) status);
   return 0;

Revision history for this message
Steve Langasek (vorlon) wrote :

Franz, I am attaching a series of files to aid in debugging here (a pair of EFI executables and a test key). Could you please do the following:

 - on your USB stick (based on any of 12.04.2, 12.10, or 13.04 - doesn't matter), mount the UEFI boot partition
 - copy LockDown.efi onto the partition - anywhere is fine
 - copy shimx64.efi to /EFI/ubuntu/BOOTX64.EFI on the partition
 - unmount
 - boot the system to the firmware, and enter the machine in Secure Boot Setup mode
 - insert the USB stick in the machine and browse to its UEFI boot partition
 - run ("boot") the LockDown.efi program
 - try to boot the USB stick (either from a normal "boot" option, or by browsing to \EFI\ubuntu\BOOTX64.EFI)

Please let me know if this succeeds or if it still fails in the same way.

Revision history for this message
Steve Langasek (vorlon) wrote :
Revision history for this message
Steve Langasek (vorlon) wrote :
  • DB.crt Edit (1.0 KiB, application/x-x509-ca-cert)
Revision history for this message
Steve Langasek (vorlon) wrote :
Revision history for this message
Franz Hsieh (franz-hsieh) wrote :

@Steve,

Please help me check if my steps are correct.

note: The platform runs Ubuntu-12.04.2 for ASUS image.

<BOOT the platform to non-secure mode>
1. copy LockDown.efi to /boot/efi/ <EFI partition mount point>
2. copy shimx64.efi to /boot/efi/EFI/ubuntu/BOOTX64.EFI
3. reboot and change to secure mode in BIOS
5. boot
6. failed (Secure Boot Violation, see the picture)

Revision history for this message
Stéphane Graber (stgraber) wrote :

So at Steve's request, I tested the new shim here and while it properly starts grub, it's actually worse than the in-archive version as the new one will also hang when booting a signed kernel (for me, the in-archive one works only for signed kernels).

Running with grub in debug mode (set debug=all), I see it hang in the shim callback in both cases (signed and unsigned).

Revision history for this message
Steve Langasek (vorlon) wrote : Re: [Bug 1187233] Re: Grub2 fails on ASUS X201E with secure boot is enabled

Hi Franz,

On Fri, Jul 05, 2013 at 09:07:13AM -0000, Franz Hsieh wrote:
> Please help me check if my steps are correct.

> note: The platform runs Ubuntu-12.04.2 for ASUS image.

> <BOOT the platform to non-secure mode>
> 1. copy LockDown.efi to /boot/efi/ <EFI partition mount point>
> 2. copy shimx64.efi to /boot/efi/EFI/ubuntu/BOOTX64.EFI
> 3. reboot and change to secure mode in BIOS

This step is wrong. After copying LockDown.efi to /boot/efi, you next need
to *boot* LockDown.efi from the firmware while in setup mode. LockDown.efi
handles the process of configuring the firmware's SecureBoot support to
include the key used for signing this shim binary, so that you can do a true
SecureBoot boot with a test binary.

After running LockDown.efi, you should be able to boot shimx64.efi in Secure
Boot mode without a security violation.

Revision history for this message
Steve Langasek (vorlon) wrote :

Hi Franz,

Any further updates here? Did my clarification of the steps make sense?

Changed in shim (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Franz Hsieh (franz-hsieh) wrote :

@Steve

We have run LockDown.efi and then enable secure boot.

The errors are attached in the picture.

Ara Pulido (ara)
Changed in shim (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Steve Langasek (vorlon) wrote :

Hi Franz,

On Wed, Jul 17, 2013 at 06:53:59AM -0000, Franz Hsieh wrote:
> We have run LockDown.efi and then enable secure boot.

> The errors are attached in the picture.

> ** Attachment added: "17 下午2:50:10.jpeg"
> https://bugs.launchpad.net/ubuntu/+source/shim/+bug/1187233/+attachment/3739636/+files/17%20%E4%B8%8B%E5%8D%882%3A50%3A10.jpeg

Thanks for the test. It looks like we're getting farther. The error
messages here indicate that the \EFI\ubuntu\grubx64.efi on this disk is not
signed with the Canonical key. In fact, it's not signed by any key ("Empty
security header"). Can you double-check your image, and make sure to use
the unmodified grubx64.efi from the standard Ubuntu image? The *only*
change from the standard Ubuntu image at this point should be the copy of
shim.

Revision history for this message
Franz Hsieh (franz-hsieh) wrote :

I use ubuntu-13.04 image to create a bootable usb stick.
Copy shimx64.efi to <USB:>/EFI/ubuntu/BOOTX64.EFI,
Enter setup mode and run LockDown.efi to import keys.
Add boot entry and assign <USB>/EFI/ubuntu/BOOTX64.EFI, and then boot to this entry.

I finally got the same result of #13.

Is there any wrong in my steps?

Revision history for this message
Ara Pulido (ara) wrote :

Confirmed with Emily Chien that this can be High, instead of Critical

Changed in oem-priority:
assignee: James M. Leddy (jm-leddy) → Ara Pulido (apulido)
importance: Critical → High
Revision history for this message
Steve Langasek (vorlon) wrote :

Franz, the steps you've taken here sound absolutely correct, so I don't understand how it ends up with shim unable to verify grub.

There will be an updated signed shim in saucy shortly. It would be good if you could retest with the stock saucy daily images once that lands.

Revision history for this message
Ara Pulido (ara) wrote :

Steve, is the updated shim now available to test?

Revision history for this message
Steve Langasek (vorlon) wrote :

Ara, Franz, the updated shim is now available in saucy. Today's daily image should include everything. http://cdimage.ubuntu.com/daily-live/current/saucy-desktop-amd64.iso

Revision history for this message
Steve Langasek (vorlon) wrote :

waiting for feedback on the new shim in saucy.

Changed in shim (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Franz Hsieh (franz-hsieh) wrote :

@Steve

I tested saucy 20130912 build on ASUS X200CA with secure boot enabled.
Now ubuntu can be successfully boot and install on this platform.

The grub version is 2.00-18ubuntu1

Revision history for this message
Franz Hsieh (franz-hsieh) wrote :

The passed BIOS versions are 203 and 207.

Revision history for this message
Steve Langasek (vorlon) wrote :

thanks, marking this fixed for saucy.

Changed in shim (Ubuntu):
status: Incomplete → Fix Released
Revision history for this message
Ara Pulido (ara) wrote :

Can we have this fixed in Precise as well?

Revision history for this message
Ara Pulido (ara) wrote :
Ara Pulido (ara)
Changed in oem-priority:
milestone: none → ubuntu12.04.4
status: Confirmed → Fix Committed
Changed in shim (Ubuntu Precise):
status: New → Fix Committed
Revision history for this message
Ara Pulido (ara) wrote :

12.04.4 is now released. Marking as Fix Released in the OEM priority project

Changed in shim (Ubuntu Precise):
status: Fix Committed → Fix Released
Changed in oem-priority:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.