Bug 1292615 - Double free when kernel does not match EFI secure boot keys
Summary: Double free when kernel does not match EFI secure boot keys
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: grub2
Version: 25
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Peter Jones
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1317680 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-12-17 22:50 UTC by Linus Torvalds
Modified: 2017-12-12 11:09 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-12-12 11:09:00 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1313048 0 unspecified CLOSED EFI boot error after installation 2023-09-14 03:18:42 UTC

Internal Links: 1313048

Description Linus Torvalds 2015-12-17 22:50:29 UTC
Description of problem:

I updated my main desktop to a Skylake CPU on an ASUS motherboard. Fedora 23 installed fine, although with the old kernel it uses the GPU isn't getting the loving it needs by default. 

However, when I then built my own kernel, grub2 failed to load it with a incomprehensible error message:

  double free at 0x616f5760
  Aborted. Press any key to exit.

which is obviously not very useful information.

It turns out that this is triggered by the fact that the ASUS motherboard comes with secure boot enabled, and I had forgotten to remove the keys for that.

But rather than report a key failure that would have informed me of my mistake, grub2 just screwed up entirely, and made the error rather obscure.

Version-Release number of selected component (if applicable):

grub2-tools-2.02-0.25.fc23.x86_64

How reproducible:

It seems to be 100% reproducible given the setup: secure boot enabled, but an unsigned kernel.

Steps to Reproduce:
1. Install current F23
2. Build your own kernel
3. Profit

Actual results:

Confusing internal failure at the boot loader stage.

Expected results:

"The selected kernel is nor signed by the system keys" or similar.

Additional info:

Motherboard: ASUS Z179-K
BIOS is the ASUS version of an AMI BIOS with UEFI.
Everything works fine once secure boot has been disabled.

Comment 1 Linus Torvalds 2015-12-23 18:58:46 UTC
Also reported this upstream to the grub2 people, but they point out that the whole secure boot infrastructure is a RH addition, and hasn't been merged upstream yet.

So it's all on you guys.

Btw, how do I change the severity? This is actually pretty bad, because with the combination of 

 (a) the Fedora 23 4.2-based kernel is unusable on modern PC's due to Skylake graphics going into some old VGA-only mode

 (b) building your own kernel results in people thinking they did something wrong

most modern machines you buy today will be considered "doesn't work well with Fedora".

Comment 2 Brian Lane 2016-03-14 21:24:36 UTC
*** Bug 1317680 has been marked as a duplicate of this bug. ***

Comment 3 Adam Williamson 2016-04-14 15:51:40 UTC
There's another current double free bug:

https://bugzilla.redhat.com/show_bug.cgi?id=1313048

not sure if it's the same one, I would've figured that kernel would be signed (from the screenshot it looks like he was booting a Fedora kernel), but perhaps not.

Comment 4 Thorsten Leemhuis 2016-05-19 07:47:32 UTC
Saw this problem again on a F23 machine and notice this might be a dupe of Bug 1278508 – at least the latter comments in that report indicate the problem only happens when booting unsigned/non-trusted kernels on a Secure Boot enabled system. That alone is bad already, but due to Bug 1334628 you afaics can't easily disable the secure boot restriction via mokutil currently :-/

Comment 5 Jim Cromie 2016-07-03 13:18:18 UTC
me too.
but in my case, theres only the 1st line, no "press any key to continue"
I have to power cycle the laptop.

hex-number is different for each rcX kernel I tried,
dunno if it changes on each boot.

FWIW, I installed fc24 beta on a brand new laptop,
on 6/6/16 (at least thats the datestamp here)
-rw-------. 1 root root 1229 Jun  6 17:44 anaconda-ks.cfg

model name	: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz

Comment 6 Levente Farkas 2016-11-20 20:17:04 UTC
the same happened with me with the latest fedora 24 :
kernel-core-4.8.8-200.fc24.x86_64
shim-0.8-9.x86_64
efibootmgr-14-3.fc24.x86_64
efivar-libs-30-4.fc24.x86_64
grub2-efi-2.02-0.34.fc24.x86_64

centos 7.2:
kernel-3.10.0-327.36.3.el7.x86_64
shim-0.9-2.el7.x86_64
efibootmgr-0.8.0-7.el7.x86_64
efivar-libs-0.11-1.el7.x86_64
grub2-efi-2.02-0.34.el7.centos.x86_64

I can boot from bios (ie select centos or fedora), but when I try to use fedora's grub2 and regenerate the fedora's grub.cfg to include centos in it's menu ie:
grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

then I'm not able to boot centos through fedora's grub. the only thing i've got is a double free.

ps. anyway it's my Asus UX360UA laptop with UEFI boot and secure boot enabled.

Comment 7 Fedora End Of Life 2016-11-24 14:18:59 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 8 Levente Farkas 2016-11-24 15:06:12 UTC
it's still happened in fedora 25.

Comment 9 Peter Jones 2016-12-06 19:55:54 UTC
Can somebody verify if the update here fixes this: https://bodhi.fedoraproject.org/updates/FEDORA-2016-ee4d91769e ?  I believe it will.

Comment 10 Levente Farkas 2016-12-07 13:44:51 UTC
it's better. ie not double free. BUT if I put the bios into secure boot enable state then i've got "invalid signature". I try to dual boot on my laptop centos and fedora from fedora's grub2 AND also enable secure boot. probably in this case fedora only see fedora's key but not centos key (but i don't know how it's working). but it's still seems not possible.
without secure boot enable it's working.

Comment 11 Fedora Update System 2016-12-07 14:35:44 UTC
grub2-2.02-0.35.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-a098b75b13

Comment 12 Fedora Update System 2016-12-08 04:53:14 UTC
grub2-2.02-0.35.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-a098b75b13

Comment 13 Fedora Update System 2016-12-08 15:56:39 UTC
grub2-2.02-0.38.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-a098b75b13

Comment 14 Fedora Update System 2016-12-08 19:23:13 UTC
grub2-2.02-0.38.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-a098b75b13

Comment 15 Fedora Update System 2016-12-11 21:54:26 UTC
grub2-2.02-0.38.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 16 Fedora End Of Life 2017-11-16 19:41:11 UTC
This message is a reminder that Fedora 25 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 25. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '25'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 25 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 17 Fedora End Of Life 2017-12-12 11:09:00 UTC
Fedora 25 changed to end-of-life (EOL) status on 2017-12-12. Fedora 25 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.