mjg59
I wrote about the technical details of supporting the UEFI secure boot specification with Linux. Despite me pretty clearly saying that this was ignoring issues of licensing and key distribution and the like, people are now using it to claim that Linux could support secure boot with minimal effort. In a sense, they're right. The technical implementation details are fairly straightforward. But they're not the difficult bit.
This doesn't sound like too much of a problem. But it is. Imagine we have a signed Linux bootloader and a signed Linux kernel, and that these signatures are made with a globally trusted key. These will boot on any hardware using secure boot. Now imagine that an attacker writes a kernel module that sets up a fake UEFI environment, stops the kernel from running code and then executes the Windows bootloader - kind of like kexec, but a little more fiddly. The Windows bootloader believes that it's performing a secure boot, but in fact everything that it believes is trustworthy is the attacker's fake UEFI code. The user's encryption passphrase is logged, the Windows kernel is modified to hide the Linux code and despite everything looking fine your credit card details are on their way to China. In this scenario, the signed Linux kernel is simply used as a malware loader. The only sign that anything is wrong is that boot will be slightly slowed down.
Signing the kernel isn't enough. Signed Linux kernels must refuse to load any unsigned kernel modules. Virtualbox on Linux? Dead. Nvidia binary driver on Linux? Dead. All out of tree kernel modules? Utterly, utterly dead. Building an updated driver locally? Not going to happen. That's going to make some people fairly unhappy.
(The same applies to Windows, of course. Windows 7 allows you to disable driver integrity checks. Windows 8 will have to forbid that when the system's using secure boot)
There's a few things missing from this, namely:
So no, custom mode doesn't make everything ok. Custom mode with a mandated UI and a documented key format would be much closer, but it wouldn't solve the problem of unattended automated installs.
Secure boot requires that all code that can touch hardware be trusted
Right now, if you can run unstrusted code before the OS then you can subvert the OS. Secure boot gives you a mechanism for making sure you only run trusted code, which protects against that. So your UEFI drivers have to be signed, your bootloader has to be signed, and your bootloader must only load a signed kernel. If you've only booted trusted code then you know that your OS is safe. But, unlike trusted boot, secure boot provides no way for you to know that only trusted code was executed. That has to be ensured by OS policy.This doesn't sound like too much of a problem. But it is. Imagine we have a signed Linux bootloader and a signed Linux kernel, and that these signatures are made with a globally trusted key. These will boot on any hardware using secure boot. Now imagine that an attacker writes a kernel module that sets up a fake UEFI environment, stops the kernel from running code and then executes the Windows bootloader - kind of like kexec, but a little more fiddly. The Windows bootloader believes that it's performing a secure boot, but in fact everything that it believes is trustworthy is the attacker's fake UEFI code. The user's encryption passphrase is logged, the Windows kernel is modified to hide the Linux code and despite everything looking fine your credit card details are on their way to China. In this scenario, the signed Linux kernel is simply used as a malware loader. The only sign that anything is wrong is that boot will be slightly slowed down.
Signing the kernel isn't enough. Signed Linux kernels must refuse to load any unsigned kernel modules. Virtualbox on Linux? Dead. Nvidia binary driver on Linux? Dead. All out of tree kernel modules? Utterly, utterly dead. Building an updated driver locally? Not going to happen. That's going to make some people fairly unhappy.
(The same applies to Windows, of course. Windows 7 allows you to disable driver integrity checks. Windows 8 will have to forbid that when the system's using secure boot)
Licensing
GPLv3 has various requirements for signing keys to be available. Microsoft's new requirement that systems support the installation of user keys would let users boot their own modified bootloaders, so that may end up being sufficient to satisfy the license. But we're then beholden on Microsoft - if they remove that requirement then users lose that freedom, and suddenly we're in an awkward licensing situation. There are ongoing conversations about exactly what we're able to do here, but it's not a solved problem.Key distribution
The UEFI spec doesn't describe or mandate a central certifying authority. Microsoft require that everyone carry their key. We could generate our own, but we have much less sway with vendors. There's no way to guarantee that all hardware vendors will generate our key. And, obviously, if we generate a key, we can't just hand the private half out to others. That means that it becomes impossible for people to produce derivative versions of Linux distributions without getting their own key. The kind of identity verification that would be required for getting such a key is likely to be expensive, and also fairly likely to require that the distribution have a legally registered company in order to facilitate the identity verification. Think Extended Validation certificates, not Startssl Free. Hobbyist Linux distributions will be a thing of the past.Doesn't custom mode fix this?
Microsoft's certification requirements now state that all systems must support a custom mode, implying that it will be possible for a user to install their own keys. Linux vendors would then be able to ship with their own keys on the install media and impose their own policies. Everyone's happy. It's not really good enough, though. People have spent incredible amounts of time and effort making it easy to install Linux by doing little more than putting a CD in a drive. Asking them to go into the firmware and reconfigure things adds an extra barrier that restricts the ability to install Linux to more technically skilled users. And it's even worse than that. This is the full description of the requirement for custom mode:- It shall be possible for a physically present user to use the Custom Mode firmware setup option to modify the contents of the Secure Boot signature databases and the PK.
- If the user ends up deleting the PK then, upon exiting the Custom Mode firmware setup, the system will be operating in Setup Mode with Secure Boot turned off.
- The firmware setup shall indicate if Secure Boot is turned on, and if it is operated in Standard or Custom Mode. The firmware setup must provide an option to return from Custom to Standard Mode which restores the factory defaults.
There's a few things missing from this, namely:
- Any description of the UI. It's effectively impossible to document Linux installation when the first step becomes (a) complicated and (b) vendor specific. Vendors are using the UEFI transition to differentiate themselves by coming up with their own unique firmware interfaces. Custom mode is going to look different everywhere.
- Any description of the key format. A raw binary representation of the key? An EFI_SIGNATURE_DATA struct? A base64 encoding of one, further protected with ROT13? We just don't know.
- Any way to use custom mode for unattended installs. It's a firmware interface that requires a physically present user. Want to install a few thousand machines over the network? This isn't a scalable approach
- …and this one's nitpicking, but there's not actually any requirement that the user be able to add keys - a vendor could conform to this language by only letting users delete keys. This is actually ok as long as the user deletes Pk, because then we'll effectively be back in setup mode and can install our own keys from the installer, but it still results in some practical problems
So no, custom mode doesn't make everything ok. Custom mode with a mandated UI and a documented key format would be much closer, but it wouldn't solve the problem of unattended automated installs.
windows8-hardware-cert-requirements-system.pdf
Date: 2012-01-18 02:39 am (UTC)windows8-hardware-cert-requirements-system.pdf (http://msdn.microsoft.com/en-us/library/windows/hardware/hh748200.aspx)
direct link (http://download.microsoft.com/download/A/D/F/ADF5BEDE-C0FB-4CC0-A3E1-B38093F50BA1/windows8-hardware-cert-requirements-system.pdf)
MANDATORY: Enable/Disable Secure Boot. On non-ARM systems, it is required to implement the ability to disable Secure Boot via firmware setup. A physically present user must be allowed to disable Secure Boot via firmware setup without possession of PKpriv.
Disabling Secure MUST NOT be possible on ARM systems.
i wonder, whether disabling a user to disable SecureBoot is something European Commission would like to have a word with M$ about
Re: windows8-hardware-cert-requirements-system.pdf
Date: 2012-01-18 04:29 pm (UTC)Re: windows8-hardware-cert-requirements-system.pdf
From: (Anonymous) - Date: 2012-01-25 08:22 am (UTC) - ExpandRe: windows8-hardware-cert-requirements-system.pdf
From: (Anonymous) - Date: 2012-01-18 04:31 pm (UTC) - ExpandRe: windows8-hardware-cert-requirements-system.pdf
From: https://www.google.com/accounts/o8/id?id=AItOawkHvEEcVEl_r9JjcntekJ7_LvA4CrE5cvw - Date: 2012-01-19 04:45 pm (UTC) - ExpandRe: windows8-hardware-cert-requirements-system.pdf
From: (Anonymous) - Date: 2012-06-06 09:31 pm (UTC) - ExpandRe: windows8-hardware-cert-requirements-system.pdf
From: (Anonymous) - Date: 2012-06-22 09:07 pm (UTC) - ExpandCan you say, "UEFI"?
From: (Anonymous) - Date: 2012-08-31 01:10 am (UTC) - ExpandGenerating keys
Date: 2012-01-18 04:22 am (UTC)Installfests!
Date: 2012-01-18 04:34 am (UTC)....pointless banter
Date: 2012-01-18 04:57 am (UTC)Please, explain. better
Date: 2012-01-18 07:14 am (UTC)Isn't the kernel allowed to execute untrusted code (say - nvidia blob) because of a technical UEFI reason,
or will it refuse to execute by choice (read: stay into UEFI domain/respect what uefi secure boot should be used about?)
Re: Please, explain. better
Date: 2012-01-19 12:36 am (UTC)The proper take-away from this is that such a signed Linux kernel won't exist.
Note that this also implies that if a bug is ever found in a signed Windows kernel that allows arbitrary code execution in kernel space, then the security of the whole system will also be undermined. It doesn't matte if Microsoft subsequently patches that bug; once the signed-but-buggy kernel is out in the wild then it can be used to build a signed malware bootloader.
Asking for the UEFI admin password when before loading an unsigned kernel?
Date: 2012-01-18 08:27 am (UTC)Re: Asking for the UEFI admin password when before loading an unsigned kernel?
Date: 2012-01-18 11:25 am (UTC)Re: Asking for the UEFI admin password when before loading an unsigned kernel?
From: (Anonymous) - Date: 2012-01-19 11:59 am (UTC) - ExpandServer vs. Client
Date: 2012-01-18 09:11 am (UTC)Too many issues
Date: 2012-01-18 11:23 am (UTC)From the security issues I've seen in servers and desktops in more than 10 years, daily, I can say I've not seen too much issues, that could have been avoided by this technology in comparison to other issues.
I'm more worried about bad fonts in HTML5 or PDF, than in the boot stage of my home desktop.
To much issues, just to put other brake on Linux, they do not mean security of the final user at all.
Re: Too many issues
Date: 2012-01-18 08:21 pm (UTC)David Kemp
Date: 2012-01-18 12:36 pm (UTC)no subject
Date: 2012-01-18 02:32 pm (UTC)no subject
Date: 2012-01-18 03:11 pm (UTC)Personally I can't imagine server machines which won't run linux from being too popular, so MS may have a problem (or split the hardware market) there. But in other cases...
From my point of view I'm not much fussed about whether linux could support secure boot, only about whether I can still install the kernel and drivers I want to use.
(no subject)
From: (Anonymous) - Date: 2012-01-19 12:05 pm (UTC) - Expandno subject
Date: 2012-01-18 03:32 pm (UTC)What about using BIOS module?
Date: 2012-01-18 05:09 pm (UTC)Re: What about using BIOS module?
Date: 2012-01-19 12:19 am (UTC)unsigned kernel modules
Date: 2012-01-18 06:55 pm (UTC)Who would emplace & enforce this constraint?
Re: unsigned kernel modules
Date: 2012-01-18 11:31 pm (UTC)Re: unsigned kernel modules
From: (Anonymous) - Date: 2012-01-19 08:04 am (UTC) - ExpandRe: unsigned kernel modules
From: (Anonymous) - Date: 2012-01-19 08:06 am (UTC) - ExpandUEFI Secure booting is actually a good thing for linux
Date: 2012-01-19 10:18 am (UTC)There are not many. That is true. But still, there are enough, and Linux is a great OS, so you should support businesses who support Linux. Hence, buying OEM equipment which comes with M$ products is your Freedom, but it not supporting Freedom!
More on this on my Blogpost here http://linuxpixies.blogspot.com/2012/01/uefi-secure-booting-is-good-for-linux.html
Re: UEFI Secure booting is actually a good thing for linux
Date: 2012-01-19 11:36 am (UTC)Re: UEFI Secure booting is actually a good thing for linux
From: (Anonymous) - Date: 2012-01-19 08:07 pm (UTC) - ExpandRe: UEFI Secure booting is actually a good thing for linux
From: (Anonymous) - Date: 2012-01-23 05:19 am (UTC) - Expandno subject
Date: 2012-01-19 05:43 pm (UTC)Configuring Keys
Date: 2012-01-19 08:54 pm (UTC)There should be a conditionally enabled APIs for installing keys.
Re: Configuring Keys
Date: 2012-01-24 04:43 am (UTC)no subject
Date: 2012-01-23 05:36 am (UTC)Not to mention the build system.
It's only a matter of time before a rogue operating system is released using the misappropriated key data of an unfortunate OEM vendor. I hear that there are still some nation states with enough cash to fund this sort of subversive activity.
Ps.BOFH, I received an error while logging in using Google Appspot OpenID
ARM disabling custom boots ?
Date: 2012-02-13 10:30 pm (UTC)UEFI signing yes sure...
Date: 2012-02-15 06:32 pm (UTC)I always think the hole thing will be like BlueRay, the key leaks, c´mon, such a big PKI that is used world wide, there will be someone who builds a massive network to crack the key, or someone will leak it..
Anyway, there will be some windows kernel module from some hardware distributor, that is signed and has a bug to allow execution of kernelmode custom code.. There has to be only one simple bug in a whole bunch of code, that breaks the system for all keys out there.
This will happen and it will be used by RootKits and so on, so the whole system is fucked up anyway..
In case of problems?
Date: 2012-02-15 11:33 pm (UTC)What would happen if a virus could get with the Windows keys which is more likely than: "Now imagine that an attacker writes a kernel module that sets up a fake UEFI environment, stops the kernel from running code and then executes the Windows bootloader - kind of like exec, but a little more fiddly. The Windows bootloader believes that it's performing a secure boot, but in fact everything that it believes is trustworthy is the attacker's fake UEFI code"; even thought my boot safe computer the key could be compromised?. If that theory not true? if is the case, then we have the same security than we have now and again is for secure the cashflow from... Otherwise and at the end is not my decision as hardware purchaser to decide what to do with it and what OS I would like to install and what risks I want or can assume?. Is more dangerous to drink Coca-Cola or drive a car or even go to work than use a computer (My life could be threatened in some cases and is more important than my HD information anyway).
Definitively I must to buy a computer with coreboot or not big-brand computer.
no subject
Date: 2012-02-16 06:31 am (UTC)Kernel modules - If I'm understanding this part correctly, the issue is that loading unsigned modules would be a security risk? If that's the case, couldn't Linux simply whitelist some necessary unsigned modules, such as nvidia and vmware, while refusing to load any others?
Key distribution - What exactly differentiates, say, Mint from Ubuntu, such that it would need a different key? At what point has a distro diverged to where it needs to have its own key? Is there some way a single "GNU Linux OS" key could be registered for all distributions?
Custom mode - Would it be unfair to assume that organizations planning to install Linux across thousands of workstations would choose to only buy hardware that allows for unattended installs? The market would seem to dictate this, even if the UEFI spec doesn't.
no subject
Date: 2012-02-16 12:17 pm (UTC)You need a signing key to sign your bootloader and kernel. If Mint shipped identical binaries that were identical to Ubuntu then they could get by without needing their own key, but if they built their own kernel or bootloader they'd need to be able to re-sign them. If Ubuntu let them use their key, what would happen if Mint introduced a bug that let their bootloader load arbitrary code? If it were signed with Ubuntu's key then Ubuntu would look bad, and people would want to blacklist that key.
It's likely that organisations that need remote installation would only buy machines that support it. But we don't know how those machines would work yet.
Delegate UEFI for appliances only
Date: 2012-03-17 09:09 pm (UTC)For a secure operating system, to respect UEFI security when requiring a system patch or upgrade the vendor must always include the entire system. The certificate applies to the whole deliverable, and you should not accept patches. Patch ability makes your system half safe and opens the door to security breeches.
Imagine the hardware vendor costs if he wants his logo within a UEFI bios for his new tablet, net-book, server, or whatever. His costs will soar as replacing one chip on the mother board with one from another vendor may change the motherboard checksum.
The software developer, the student in a computer science class, the applications seller, the embedded controller vendor, are their efforts and products going to fall under the UEFI requirements?
UEFI is doomed to fail, and will be replaced by something better.
A (maybe stupid) Question
Date: 2012-04-23 10:17 pm (UTC)The only real solution (in my opinion) is TPM, or MAC security. If MAC security is implemented by the OS, then drivers would not need to be signed (presuming that the purpose is to prevent malware). The MAC security can prevent user applications from modifying any part of the OS. If neither MAC, nor adding executables to the chain is implemented, malware could then simply interpose in an OS (being part of the executable, rather than part of the OS -- classic virus strategy).
If the executable were protected by the OS, how does application installation work? I don't know the mechanism for updates here (Microsoft would have to have a Secure Apps Store for Windows 8 to make this part work).
I would expect that (at the least) any program that can generate an executable would need signing, and the OS mechanism for allowing an executable (in Linux terms, chmod and the OS loader) would require signing as well.
Where does UEFI Secure Boot responsibility actually end?
Sorry for the question -- I haven't read the UEFI specification, and this may be covered in there.
I don't have time to read replies -- please email at fred (dot) weigel (at) treklogic (dot) com
OT
Date: 2012-06-07 09:54 am (UTC)Gosh, for a moment I was worried they could go to the US. I'd rather prefer Chinese bank robbers.
Ok, so what should I ask my hardware vendor?
Date: 2012-06-22 08:04 pm (UTC)Re: Ok, so what should I ask my hardware vendor?
Date: 2012-06-22 08:12 pm (UTC)