7 ms·
Geeking Out with UEFI
- tsjq 6y agoI remember when UEFI was about to be released, there were a lot of concerns about how this will completely block Linux installation, dual boot, etc on Windows computers. Did that problem happen? How was that solved?
- salawat 6y agoTechnically solved by allowing you to manage your own keys. Just what any hobbyist wants to do to dual boot though. Sit down and read up on cryptographic signature verification! That'll make the hobby more approachable.
- freeone3000 6y agoDKMS allows for drivers to be installed without breaking the kernel signature. And Ubuntu and Red Hat and Fedora are all MS-signed (as will anyone else willing to go through the process, which is really only feasible for large orgs but is mostly just bureaucracy). So most hobbists will never need to mess with mokutil.
- pantalaimon 6y ago> DKMS allows for drivers to be installed without breaking the kernel signature. how is this possible?
- reanimus 6y agoYou register an additional key, generated by you/the installer. Ubuntu automates it as part of setup, afaik Fedora doesn't but there are instructions for it. Ubuntu generates a key during installation, then requests UEFI register it as a secure boot signing key. You reboot, UEFI will verify in pre-boot that you asked for the key to be added (usually, some BIOSes let you disable this check). DKMS will use that key to sign the modules. Since the kernel gets the UEFI allowed keys from the firmware, it will see these signed modules as valid and load them.
- MertsA 6y agoIt's not, if a kernel was built and signed that allowed unsigned modules to be loaded that key should be revoked. The way kernel module loading works with secure boot is that modules are signed via kmodsign. https://ubuntu.com/blog/how-to-sign-things-for-secure-boot https://ubuntu.com/blog/how-to-sign-things-for-secure-boot
- reanimus 6y agoI actually really enjoyed learning about secure boot keys and TPMs and all when I was setting it up on my machine. Support for managing keys varies by board; some, especially older ones, don't let you do much, if at all, especially from within Linux. With modern firmware, you can add a self-generated key pretty easily, and it's not hard to do secure boot dual boot with Linux (or even macOS if you're using OpenCore, I think!). It does require a bit of reading up though. :)
- noja 6y agoShims. MS signed some at the start, see https://docs.fedoraproject.org/en-US/Fedora/18/html/UEFI_Secure_Boot_Guide/sect-UEFI_Secure_Boot_Guide-Implementation_of_UEFI_Secure_Boot-Shim.html https://docs.fedoraproject.org/en-US/Fedora/18/html/UEFI_Sec... or https://wiki.debian.org/SecureBoot#Shim https://wiki.debian.org/SecureBoot#Shim
- navaati 6y agoWhat I don’t understand is, how did that not completely nullify the security promises of SecureBoot, rendering the whole exercise pointless in the end ?
- wmf 6y agoInsecure shims can be revoked. https://blogs.gnome.org/hughsie/2020/08/17/updating-secure-boot-dbx-with-fwupd-and-the-lvfs/ https://blogs.gnome.org/hughsie/2020/08/17/updating-secure-b...
- deleted 6y ago[deleted]
- voxic11 6y agoBecause the shim is still secure. > Shim then becomes the root of trust for all the other distro-provided UEFI programs. It embeds a further distro-specific CA key that is itself used for signing further programs (e.g. Linux, GRUB, fwupdate). This allows for a clean delegation of trust - the distros are then responsible for signing the rest of their packages. Shim itself should ideally not need to be updated very often, reducing the workload on the central auditing and CA teams.
- monoideism 6y agoBecause each stage of the boot sequence is still verified: - the root of trust is in the TPM - by default, the initial shim stage is verified using a Microsoft cert in the native trust database, and after the shim (which has an embedded Canonical cert) loads grub, then it verifies and loads the kennel Grub also has its own trust store it can use, if I recall.
- rmrfstar 6y agoYou can manage your own secure boot keys [1]. [1] https://www.linuxjournal.com/content/take-control-your-pc-uefi-secure-boot https://www.linuxjournal.com/content/take-control-your-pc-ue...
- Sunspark 6y agoThe bios in my computer has a toggle for secure boot to be on or off. I've had it off the whole time and there was no effect on any OS as a result. The issue was limited to bios setups that didn't allow this to be toggled, and for those, as pointed out by another, signed shims resolved that issue.
- MertsA 6y agoEven without the shims, right from the start Microsoft was requiring that OEMs allow secure boot to be disabled in settings if they wanted to pass Microsoft's "Windows Certification" requirement.
- rbecker 6y agoA requirement they later dropped: https://tech.slashdot.org/story/15/03/20/2039251/oems-allowed-to-lock-secure-boot-in-windows-10-computers https://tech.slashdot.org/story/15/03/20/2039251/oems-allowe... First they require a lock, but also that the user gets the key. Next they require a lock, but the key may be withheld from the user. I wonder what they will require next. Their Surface RT line of laptops came without unlockable secure boot, so no alternative OS could be installed.
- p_l 6y agoThis is the problem with people not understanding how Secure Boot works, then reading specs that require such understanding. For max-level compatibility with Windows 10 Enterprise, there's a requirement that owner of the device can change all the keys. It doesn't require a "disable Secure Boot" setting. Worst case, the device won't permit you to keep it in what's called "Setup Mode" without some inconvenience, however you have to be able to enter Setup Mode. What's Setup Mode? Setup Mode is when the PK variable (PlatformKey) is empty, effectively disabling SecureBoot. This mode exists so that you can load new PK value. According to UEFI Secure Boot spec, it's supposed to be frozen by manufacturer. However, being able to set your own one is critical to some of the Windows Enterprise features, and as such a way to enter that mode is required by Windows certification.
- MayeulC 6y agoI think fear of an antitrust lawsuit is what kept Microsoft from locking it down completely (IIRC they did it on their RT line for a while, though).
- p_l 6y agoThe UEFI spec insists on locked down - Microsoft sells features that depend on it being open, and sells them probably for much more than the value of dealing with rabid lawyers is.
- thudson 6y agoIf you want to more easily configure UEFI Secure Boot on your Linux system, while also registering your own signing keys to eliminate the Microsoft and OEM ones: https://safeboot.dev/ https://safeboot.dev/
- Fwirt 6y agoHaving an EFI shell binary on a USB stick can be incredibly useful when you're troubleshooting boot issues. I went down this rabbit hole because the Thinkpad X1 Tablet doesn't play nice with GRUB when there's no keyboard attached, but if you setup entries directly in EFI you can select a boot partition using the touchscreen. There used to be precompiled binaries floating around in the tianocore Github repo, but it looks like the link has gone dead. See also Pete Batard's excellent project to support all kinds of exotic filesystems in EFI. http://efi.akeo.ie/ http://efi.akeo.ie/
- the_only_law 6y agoI was rather disappointed my MB didn't have a UEFI shell when I wanted to recover an completely corrupted GRUB config.
- pmoriarty 6y agoNow if only someone could write a Forth that boostraps a Lisp, which gets Emacs running on UEFI
- simcop2387 6y agoIt takes more than that, but the pieces are ready, https://news.ycombinator.com/item?id=18520231 https://news.ycombinator.com/item?id=18520231
- openfuture 6y agoDisclaimer: I didn't fully read the article yet. I wanted to mention the excellent HEADS project (as in the other side of TAILS): https://github.com/osresearch/heads https://github.com/osresearch/heads This talk is great: https://trmm.net/Heads_33c3 https://trmm.net/Heads_33c3 I remember when UEFI became a thing and people were complaining in linux forums that the keys are controlled by the manufacturers and 'the whole thing is a ploy by microsoft to kill linux' (UEFI is just a convoluted standard way to write BIOS in a certain way). Now we can control the keys, all we need to do is kick UEFI to the curb and use linux from BIOS all the way to the DE/WM (coreboot..). Turns out we can turn the boot process into a chain of kexec's and simplify everything greatly.
- will_pseudonym 6y agoI couldn't remember what "DE/WM" meant. If anyone else is in a similar situation, they stand for "desktop environment" [0] and "window manager" [1] [0] https://en.wikipedia.org/wiki/Desktop_environment https://en.wikipedia.org/wiki/Desktop_environment [1] https://en.wikipedia.org/wiki/Window_manager https://en.wikipedia.org/wiki/Window_manager
- 0xdeadb00f 6y agoThere is also this [1] Heads project which aims to be an alternative to Tails using free as in "libre" software, and a de-blobbed kernel. 1: https://heads.dyne.org/about.html https://heads.dyne.org/about.html
- spicyramen 6y agoGoogle Cloud supports UEFI via secure boot, unfortunately you need to reinstall your VM from scratch to enable it if VM was not created with an OS image which didn't support this feature.
- ajxs 6y agoIn case anyone is interested in how a UEFI bootloader could be implemented, I wrote a deliberately simple, teachable example: https://github.com/ajxs/uefi-elf-bootloader https://github.com/ajxs/uefi-elf-bootloader When I was learning there was definitely a lack of well-documented UEFI bootloader code publicly available. As someone new to the technology, you definitely don't want to sift through ELILO to find out how Linux uses UEFI. If I did this again, which I'm sure I will, I would not use GNU-EFI. I would use a cross-compiler to build a PE executable for the EFI executable directly, without using GNU-EFI. Still, GNU-EFI is a good place to start. It's much easier to work with than EDK2. Forgive my self-promotion here, I feel it could be relevant to interested parties here.
- kr99x 6y agoI'll just repeat again what I've said a few times in comment sections on UEFI-related articles: UEFI is not Secure Boot. Secure Boot is a feature that is implemented by UEFI-compliant systems these days, but UEFI systems originally shipped completely without the feature and it's still perfectly possible to do so. Complaints about Secure Boot are generally valid complaints to have. Complaints about UEFI that are actually just complaints about Secure Boot are... just complaints about Secure Boot. Valid complaints about UEFI that are unrelated to Secure Boot are rare.