More in the series of bizarre UEFI bugs
Nov. 14th, 2012 11:49 pm
mjg59
A (well, now former) coworker let me know about a problem he was having with a Lenovo Thinkcentre M92p. It booted Fedora UEFI install media fine, but after an apparently successful installation refused to boot. UEFI installs on Windows worked perfectly. Secure Boot was quickly ruled out, but this could still have been a number of things. The most interesting observation was that the Fedora boot option didn't appear in the firmware boot menu at all, but Windows did. We spent a little while comparing the variable contents, gradually ruling out potential issues - Linux was writing an entry that had an extra 6 bytes in a structure, for instance[1], and a sufficiently paranoid firmware implementation may have been tripping up on that. Fixing that didn't help, though. Finally we tried just taking the Windows entry and changing the descriptive string. And it broke.
Every UEFI boot entry has a descriptive string. This is used by the firmware when it's presenting a menu to users - instead of "Hard drive 0" and "USB drive 3", the firmware can list "Windows Boot Manager" and "Fedora Linux". There's no reason at all for the firmware to be parsing these strings. But the evidence seemed pretty strong - given two identical boot entries, one saying "Windows Boot Manager" and one not, only the first would work. At this point I downloaded a copy of the firmware and started poking at it. Turns out that yes, actually, there is a function that compares the descriptive string against "Windows Boot Manager" and appears to return an error if it doesn't match. What's stranger is that it also checks for "Red Hat Enterprise Linux" and lets that one work as well.
This is, obviously, bizarre. A vendor appears to have actually written additional code to check whether an OS claims to be Windows before it'll let it boot. Someone then presumably tested booting RHEL on it and discovered that it didn't work. Rather than take out that check, they then addded another check to let RHEL boot as well. We haven't yet verified whether this is an absolute string match or whether a prefix of "Red Hat Enterprise Linux" is sufficient, and further examination of the code may reveal further workarounds. For now, if you want to run Fedora[2] on these systems you're probably best off changing the firmware to perform a legacy boot.
[1] src/include/efi.h: uint8_t padding[6]; /* Emperically needed */, says the efibootmgr source code. Unhelpful.
[2] Or Ubuntu, or Suse, or…
Every UEFI boot entry has a descriptive string. This is used by the firmware when it's presenting a menu to users - instead of "Hard drive 0" and "USB drive 3", the firmware can list "Windows Boot Manager" and "Fedora Linux". There's no reason at all for the firmware to be parsing these strings. But the evidence seemed pretty strong - given two identical boot entries, one saying "Windows Boot Manager" and one not, only the first would work. At this point I downloaded a copy of the firmware and started poking at it. Turns out that yes, actually, there is a function that compares the descriptive string against "Windows Boot Manager" and appears to return an error if it doesn't match. What's stranger is that it also checks for "Red Hat Enterprise Linux" and lets that one work as well.
This is, obviously, bizarre. A vendor appears to have actually written additional code to check whether an OS claims to be Windows before it'll let it boot. Someone then presumably tested booting RHEL on it and discovered that it didn't work. Rather than take out that check, they then addded another check to let RHEL boot as well. We haven't yet verified whether this is an absolute string match or whether a prefix of "Red Hat Enterprise Linux" is sufficient, and further examination of the code may reveal further workarounds. For now, if you want to run Fedora[2] on these systems you're probably best off changing the firmware to perform a legacy boot.
[1] src/include/efi.h: uint8_t padding[6]; /* Emperically needed */, says the efibootmgr source code. Unhelpful.
[2] Or Ubuntu, or Suse, or…
Plan of action
Date: 2012-11-15 07:06 am (UTC)Re: Plan of action
Date: 2012-11-15 07:29 am (UTC)That takes hardware and patience though, no use to cheat.
--
Michael Shigorin
Re: Plan of action
From: (Anonymous) - Date: 2012-11-15 04:53 pm (UTC) - ExpandRe: Plan of action
From: (Anonymous) - Date: 2012-11-16 03:22 pm (UTC) - ExpandRe: Plan of action
From: (Anonymous) - Date: 2012-11-15 10:31 am (UTC) - ExpandRe: Plan of action
From: (Anonymous) - Date: 2012-11-15 05:24 pm (UTC) - ExpandRe: Plan of action
From: (Anonymous) - Date: 2012-11-15 06:08 pm (UTC) - Expanddriving up revenue
From: (Anonymous) - Date: 2012-11-15 09:43 pm (UTC) - ExpandRe: driving up revenue
From: reddragdiva - Date: 2012-11-17 08:42 am (UTC) - ExpandRe: Plan of action
From: (Anonymous) - Date: 2013-02-24 10:16 pm (UTC) - Expandno subject
Date: 2012-11-15 07:14 am (UTC)Legacy boot not a solution
Date: 2012-11-15 10:56 am (UTC)OMG
Date: 2012-11-15 11:28 am (UTC)Re: OMG
Date: 2012-11-15 03:13 pm (UTC)Re: OMG
From: (Anonymous) - Date: 2012-11-16 02:01 am (UTC) - ExpandDon't wait for Lenovo to fix this
Date: 2012-11-15 01:14 pm (UTC)This problem has been discussed for at least the last year and several BIOS revisions haven't helped.
Re: Don't wait for Lenovo to fix this
Date: 2012-11-16 07:54 pm (UTC)Could you post a link to the relevant websites/forums on the issue? Maybe I can help :)
Re: Don't wait for Lenovo to fix this
From: (Anonymous) - Date: 2013-02-01 11:42 pm (UTC) - ExpandHere we go
Date: 2012-11-15 01:19 pm (UTC)the name >>Windows 8<< here and there in firmware, I wanted to ....".
Breach of MS guidelines?
Date: 2012-11-15 06:03 pm (UTC)I'm staggered that such behaviours is not a breach of the UEFI standard.
Re: Breach of MS guidelines?
Date: 2012-11-15 06:07 pm (UTC)Re: Breach of MS guidelines?
From: (Anonymous) - Date: 2012-11-15 06:24 pm (UTC) - ExpandRe: Breach of MS guidelines?
From: (Anonymous) - Date: 2012-11-16 11:07 am (UTC) - ExpandRe: Breach of MS guidelines?
From: (Anonymous) - Date: 2012-11-16 03:46 pm (UTC) - ExpandRe: Breach of MS guidelines?
From: (Anonymous) - Date: 2012-11-26 10:23 pm (UTC) - ExpandError
Date: 2012-11-15 08:17 pm (UTC)Thx!
database of badly behaving systems
Date: 2012-11-15 10:38 pm (UTC)Simple solution
Date: 2012-11-15 11:06 pm (UTC)Not sure why they added that boneheaded check though, is there perhaps a support contract that only supports Windows and RHEL?
Re: Simple solution
Date: 2012-11-16 01:04 am (UTC)Lenovo's not the only one
Date: 2012-11-16 02:57 am (UTC)no subject
Date: 2012-11-16 07:08 am (UTC)no subject
Date: 2012-11-16 03:50 pm (UTC)Languages
Date: 2012-11-16 07:57 am (UTC)Re: Languages
Date: 2012-11-16 03:51 pm (UTC)Re: Languages
From: cxl [launchpad.net] - Date: 2012-11-16 08:03 pm (UTC) - ExpandRe: Languages
From: (Anonymous) - Date: 2013-08-29 10:43 am (UTC) - ExpandConfused
Date: 2012-11-16 08:07 am (UTC)this stinks!
Re: Confused
Date: 2012-11-16 08:05 pm (UTC)BIOS "fix"
Date: 2012-11-16 09:27 am (UTC)http://pastebin.com/LkFMYP3J
Used to catch a lot of quirks for specific models in linux kernel dealing with these "If Windows do this - if anything else - who gives a #@$@#%! ..."
Filtering out secret partitions?
Date: 2012-11-16 10:42 am (UTC)Maybe the point of this is to hide these "secret" partitions so people don't try to boot them? And during development, it was easier to have a "whitelist" rather than a "blacklist", because the team that made the partition was different than the team that wrote the BIOS?
no subject
Date: 2012-11-16 01:01 pm (UTC)I'm not saying a string check isn't happening, but the location listed above seems to override any string check.
no subject
Date: 2012-11-16 08:09 pm (UTC)Bullying h/w vendors
Date: 2012-11-16 02:11 pm (UTC)This resulted in a campaign of people buying new graphics card contacting their marketing people once and telling them that they were buying competing hardware due to diamond's refusal to support linux. Eventually this got the desired result and, if I remember correctly, diamond paid good money for their hardware to be well supported.
Maybe the same technique would work for Lenovo and others. I will either buy hardware which explicitly supports linux or build a box out of linux compatible bits. If I never buy a windows licence then it should be easy to avoid hardware which requires it :-)
Re: Bullying h/w vendors and/or the opposite
Date: 2012-11-16 09:15 pm (UTC)Best,
Pierre.
Re: Bullying h/w vendors and/or the opposite
From: (Anonymous) - Date: 2020-09-04 10:32 pm (UTC) - ExpandLenovo have some other fun EFI and BIOS "bugs" too
Date: 2012-11-16 11:30 pm (UTC)They also have a WiFi/3G card whitelist that stops you using non-Lenovo cards. When pressed they'll claim that the FCC makes them do this. When you point out that (a) you don't live in the US and what the FCC says doesn't matter; and (b) they've never cited the actual regulation in question, they'll change their story to say that "regulators" around the world make them.
Oddly, those same regulations appear to also affect HP, but not Dell or Acer.
They don't disclose their hardware lockout on their web site, sales documentation, etc.
I wrote a bit of a rant about this when it bit me a while ago. On the upside they replaced my 3G card free of charge with a Lenovo one; on the flip side, they still haven't fixed their website and the new card doesn't work as well as my old one did.
They really shouldn't be able to sell machines as "Mobile Broadband Ready" when they mean "Lenovo Mobile Broadband Card ready (approved models only, machine will fail to POST with non-approved card installed)".
Blog post with details, quotes from Lenovo emails, quotes from sales chat, etc (http://blog.ringerc.id.au/2012/06/lenovo-sales-and-support-reps-dont-get.html).
I'm about to file an ACC compliant, as I've given them long enough. Anyone else bitten by this, please file consumer protection complaints in your respective countries.
Re: Lenovo have some other fun EFI and BIOS "bugs" too
Date: 2012-11-17 12:01 am (UTC)ASUS K55N doesn't work too
Date: 2012-11-18 07:21 pm (UTC)I bought laptop ASUS k55n, and when I try boot linux in UEFI mode system is freesing. Reset helps for reboot. Does anybody have this problem too?
support costs
Date: 2012-11-19 12:54 pm (UTC)Lenovo working on update
Date: 2012-11-19 09:18 pm (UTC)Thanks for the well written article. It is unclear exactly why this was implemented as is, but we are aware of the concerns expressed here and are working on a BIOS update to address this.
Mark Hopkins,
Lenovo Services
I see something similar
Date: 2012-11-19 11:02 pm (UTC)I run a F17 and Windows dual system, where F17 and Windows are on separate disks each with its own EFI partition. When I unplug the F17 disk and boot the system, then (on next shutdown) plug the disk back in, the BIOS "can't find" the EFI bootloader on that disk. It is there. I can put it back via the livecd and grub2-install, which crucially prods the BIOS to update its boot order.
Curiously, however, the same sequence applied to the Windows disk brings the Windows Boot Manager back. Which is just as well as I don't have a PE disk capable of running bcdboot or whatever incantation is needed for Windows (yet).
This sounds like a similar issue to what you're seeing. I'm going to dissect my BIOS tomorrow and see if I see strings.
Confused as well
Date: 2012-12-10 09:36 pm (UTC)Because I see no "legacy" over UEFI options in the BIOS menu, I see I can't do that. How would I go about making this work for Ubuntu? (12.10 to be precise.)
Re: Confused as well
Date: 2012-12-20 06:30 am (UTC)Re: Confused as well
From: (Anonymous) - Date: 2012-12-21 03:03 pm (UTC) - ExpandLenovo W530
Date: 2013-02-02 06:41 pm (UTC)richard@thornton.net
Re: Lenovo W530
Date: 2013-05-13 02:15 am (UTC)Re: Lenovo W530
From: (Anonymous) - Date: 2013-05-24 05:31 pm (UTC) - ExpandRe: Lenovo W530
From: (Anonymous) - Date: 2013-05-26 11:13 am (UTC) - Expand