11 ms·
Linux Kernel Lockdown and UEFI Secure Boot
- OrangeTux 9y agoLWN article discussing the same topic[1] https://lwn.net/SubscriberLink/750730/788c6bced1612397/ https://lwn.net/SubscriberLink/750730/788c6bced1612397/
- colemannugent 9y agoSee Linus' concerns about the patchset: http://lkml.iu.edu/hypermail/linux/kernel/1804.0/01597.html http://lkml.iu.edu/hypermail/linux/kernel/1804.0/01597.html And the /r/linux discussion from earlier: https://www.reddit.com/r/linux/comments/89mtyt/linus_torvalds_expresses_his_concerns_over_the/ https://www.reddit.com/r/linux/comments/89mtyt/linus_torvald...
- atomicnumber1 9y agoOk, I this might sound pesky but what's Linus referring to when he says "my kernel". Is he referring to his personal kernel or Linux kernel in general.
- saurik 9y agoIt seems to me like the former, but with a kind of generalized "me" to indicate "all of the people who sort of think like me, with me as an example". Why do you think it could be the latter?
- deleted 9y ago[deleted]
- thanksgiving 9y agoMaybe not a native speaker or maybe someone who has difficulty comprehending written words.
- atomicnumber1 9y agoI don’t know. Sometimes I’ve difficulty with comprehension. I don’t know how to explain. I thought it was better to ask then to assume. Makes sense?
- mehrdadn 9y agoPretty sure he means "the kernel I have running on my computer" (i.e. as a user of the kernel), not "the kernel I work on" (i.e. as a developer of the kernel).
- thanksgiving 9y agoYup. It is basically a user story.
- atomicnumber1 9y agoThanks!
- deleted 9y ago[deleted]
- jsiepkes 9y agoI rember there was resistance from Torvalds to merge a similar FreeBSD-style secure level implementation parchset a while ago (to prevent runtime kernel module loading and such). Will this parchset get merged?
- shakna 9y ago> I'm done with you. You're not listening, and you're repeating bogus arguments that make no sense. > No way in hell will I merge anything like this. > Linus [0] I highly doubt it. [0] http://lkml.iu.edu/hypermail/linux/kernel/1804.0/01607.html http://lkml.iu.edu/hypermail/linux/kernel/1804.0/01607.html
- cjbprime 9y agoDon't worry, the mean time between Linus saying something like that and then merging anyway is about ten minutes.
- aepiepaey 9y agoThe "no way in hell" part clearly refers only to automatically enabling lockdown mode if the kernel was booted using secure boot. Lockdown mode itself is very likely to be merged. It becomes clearer if you read http://lkml.iu.edu/hypermail/linux/kernel/1804.0/01597.html http://lkml.iu.edu/hypermail/linux/kernel/1804.0/01597.html which was linked elsewhere in the comments here.
- shakna 9y agoI read a fair way down the thread, but Garett and Linus continue to butt heads. Michael Garett seems to think lockdown without Secure Boot makes no sense. The kernel team seem to disagree. I didn't get to a point where any resolution was met, but Linus did complain about over 100 emails wasted before a legitimate reason they should be linked came out.
- mjg59 9y ago> Michael Garett seems to think lockdown without Secure Boot makes no sense. The kernel team seem to disagree. That's not my name, but anyway. I don't think it makes no sense. I think asserting that it adds meaningful security in the absence of some other mechanism for gaining trust in the kernel is misleading, and I think the reduction in functionality associated with it isn't worth it unless you have that security benefit. As a result, I think having the default behaviour in a general purpose distribution be "Enable lockdown even if we didn't have any indication that we booted securely" doesn't make sense - more specialised projects may have a reason to do so.
- mehrdadn 9y agoI'm a little confused about something: in a locked-down kernel, what would prevent the user from just replacing the kernel image and rebooting? Would the kernel lock down the image? EDIT: Sorry for the confusion, I mean lockdown without Secure Boot -- I thought Linus was saying they were independent things, so I was trying to see how lockdown could work independently of Secure Boot.
- Karliss 9y agoSecure Boot not allowing to boot your unsigned replacement image?
- TheDong 9y agoIf secure-boot is enabled, the new image would need to be signed in order to be booted. If the user can sign an image with a trusted key, than sure, but it's assumed that an attacker does not have secureboot keys.
- Jasper_ 9y agoAndy suggests one mode of operation: a truly read-only boot filesystem that the kernel itself can't modify. And there is general agreement from all parties to add a kernel command line flag to support that use case. Otherwise, on a more general-purpose computer with a writable /boot/, some verified boot like secure boot is required to ensure that your chain of trust is established.
- mjg59 9y agoThere's a few options: 1) Your kernel is in flash and your firmware won't update it unless it's signed. In that case the fact that there's no secure boot as such is irrelevant, because you can assert that the hardware is providing a root of trust anyway 2) Your firmware measures the kernel into something like a TPM and the TPM won't release a secret that's required to boot unless that measurement is correct. https://mjg59.dreamwidth.org/35742.html https://mjg59.dreamwidth.org/35742.html describes a couple of shortcomings in that approach and how you can get around them - if you do that appropriately, there's no risk 3) Your system has some other kind of verified boot implementation (such as ChromeOS) But otherwise yes, that's the point - defaulting lockdown to on while it's still easy for an attacker to replace the kernel may not be a great default, because it removes functionality without offering much additional security.
- Arbalest 9y agoThe reason we're seeing this blog post is quite clearly due to this statement from Linus: 'This discussion is over until you give an actual honest-to-goodness reason for why you tied the two features together. No more "Why not?" crap.' Notice LKML is from the 3rd of April, and MJGs blog post from the 4th of April. Edit: correct initials
- mjg59 9y agoEh I'm not going to convince Linus by writing a blogpost. This is just to make Reddit stop complaining.
- Arbalest 9y agoThen I guess I'm completely wrong and don't deserve any points XD Somewhat annoyingly this puts me in a quandary, remove the incorrect top level post, thus the history in which the error was highlighted.
- snvzz 9y ago>until you give an actual honest-to-goodness reason for why you tied the two features together What's the point of trying to explain this outside of LKML? Convince third parties? He needs to convince Linus in LKML, rather than this sad attempt at brigading.
- Arbalest 9y agoLet's be clear here. This is about enabling Lockdown when UEFI Secure Boot is enabled by default. So the concern is essentially that binary distributions, which are going to be responsible for kernel flags, may enable this, whether it is default in the default kernel config or not. As best as I can tell that is the crux of Linus' concerns. MJG suggesting that the kernel flag can be turned off, while true, is not a response which considers the defacto usage which may result.
- mjg59 9y agoIt's something that users are guaranteed the ability to disable for all distro kernels.
- Arbalest 9y agoHow so? Adding such an ability removes the security right? If someone can set kernel flags, they could just as easily set the lockdown flag. If the package maintainers provide a different kernel image, then you still have the next boot issue. The fact that the shim exists erases any real protection against this. Therefore the only real protection comes when you put your own keys in. In which case, once again, enable lock down in the kernel config. I imagine that is exactly something enterprise vendors would be looking at. In the process of writing this, I have come to the conclusion that consumer secure boot is meaningless while the shim exists. The Microsoft approval process is, as I believe you said many years ago, fairly simple anyway. A company telephone number and a fee, if we're looking at other serious malicious actors. I acknowledge I may be misunderstanding this, and that you've already been over most/all of these issues before. I don't mind if you feel a response is not necessary.
- mjg59 9y ago> How so? Run sudo mokutil --disable-validation > Adding such an ability removes the security right? No, because the mechanism used for this requires proof that you have access to the console - a remote attacker can't do it. A local attacker could, but there's support for passwording it to prevent this (it's equivalent to passwording the firmware setup) > I acknowledge I may be misunderstanding this You are, but there's a huge amount of misinformation about this stuff out there that makes it hard to find the actual information, so it's not surprising :)
- dingo_bat 9y agoCan Linux just ignore the entire cancer that secure boot represents? There is literally no upside for the user.
- benbristow 9y agoOther than ensuring that you're booting what you think you're actually booting
- dingo_bat 9y agoI don't know if this is a general problem, but I have never had this issue. My system always boots whatever I installed.
- Jasper_ 9y agoHow are you sure you don't have a so-called "boot kit" on your machine?
- dingo_bat 9y agoBecause there are only 2 ways of that happening: 1. I run a malware as root which modifies my image. I don't run anything as root except apt. So this is impossible. 2. Someone steals my computer and modifies the disk. Again, if they have physical access, I have already failed in my security. So this scenario is irrelevant. Am I missing anything?
- mjg59 9y agoYou run malware as a user that's able to subvert some other component of your distribution (such as beep on Debian) to gain root and it does that?
- dingo_bat 9y agoGaining root without credentials is a bug of the highest order and must be fixed immediately. Existence of rare exploits that do allow privilege escalation does not mean we take capabilities away from root.
- snowwindwaves 9y agoRead the whole thread on lkml and didn't see a good argument as to why lockdown being enabled or not should depend on the way the machine was booted. Linus seemed to suggest having lockdown on by default would be reasonable, independent of boot method.
- infinity0 9y agoIndeed, having lockdown on by default would be reasonable. There is an argument that "it's useless" [1] without SecureBoot but so what? Separation of concerns is a good principle and allows external people to reason about the behaviour much more easily. There is no point implementing logic like "if x == 0 then y = 0; return x * y" when a simple "return x * y" will suffice. In fact it's actively harmful as it raises the complexity. [1] http://lkml.iu.edu/hypermail/linux/kernel/1804.0/01621.html http://lkml.iu.edu/hypermail/linux/kernel/1804.0/01621.html
- mjg59 9y agoThere's an argument that it's harmful without a verified boot chain - it doesn't add that much security in that case, but it does limit functionality. If you have enough underlying infrastructure to mean that it does add a meaningful amount of security, then the loss of functionality is a worthwhile tradeoff, but otherwise it's likely to cause justifiable user anger.
- throwaway2048 9y agothere is really no such thing as a verified boot chain on x86 anymore, microsoft leaked keys that essentially allow any binary to be booted on UEFI that uses microsoft keys, im not sure what the point of all this fuss is.
- mjg59 9y agoThey didn't. No keys were leaked. I wrote about this at the time (https://mjg59.dreamwidth.org/44223.html https://mjg59.dreamwidth.org/44223.html) but the short version is that the leaked tooling needed to carry out that attack was specific to ARM, required someone with physical access to the console to confirm the installation, and was blacklisted anyway.
- CodeArtisan 9y agoKernel and hardware lockdown could be an extreme but effective solution against cheaters in online gaming. Too controversial to being put in use though.
- mjg59 9y agoThat would still depend on a remote attestation solution that provided complete understanding of the state of the system during runtime, which isn't really close to possible with existing technology.
- dcow 9y agoWell imagine Blizzard and Apple made a deal where they worked together so that Blizzard games would only connect to verified servers if the hardware platform can cryptographically attest that the currently running kernel has been signed by Apple (doing so would prove it hasent been modified). Blizzard gets to distribute encrypted binaries and assets to users that only their registered Apple hardware running secure booted software can decrypt. Now replace Blizzard with any iOS application and you have the iOS AppStore ecosystem. We're already there. And I'm also pretty sure Blizzard and Apple have some dark back room deal like this, although it's more about Apple allowing Blizzards shit to do whatever it wants on its platform and less about methods of attestation considering everything is already in place for that.
- mjg59 9y agoWell, right now they couldn't do that because the Apple hardware platform doesn't allow it, and because the PC platform doesn't either any attempt on Apple's behalf to do so would result in gamers abandoning Apple?
- dcow 9y agoWhat do you mean? When you execute code on iOS you are executing signed binaries that the kernel verifies at install time and then user specific encrypted pages that the kernel decrypts/verifies as they're mapped into memory at execution time. I feel like we are not on the same (metaphoric) page. What I'm saying is this already exists today. iPhone hardware can attest to the integrity of the running system because Apple practices secure boot and maintains a PKI (supported by the kernel and TPM) responsible for verifying the integrity of software running on its system. Apple can say to a Blizzard "game" with certainty (barring security vulns), "there is no unauthorized software running on this system". And as far as Apple is concerned wrt their platform, Blizzard is just another app developer in their ecosystem. They don't have to pay a special "attestation premium".
- dcow 9y agoI wonder how long until the kernel is checking signatures on code pages as they're mapped into memory or modified (iOS style). Obviously no one wants the vendor gated platform lockdown aspects of any of this, but user-defined key whitelists for both kernel and userspace binaries would be really cool. I think I've heard Linus is not in favor of extending this notion to userspace binaries, or at least that he doesn't believe it should be the kernel's responsibility (for Linux anyway), though.
- mjg59 9y agoThe kernel already has support for verifying signatures on binaries - check out IMA appraisal.
- dcow 9y agoApropos: https://lwn.net/Articles/488906/ https://lwn.net/Articles/488906/ Hmm does this only apply to files though? I'm talking about kernel signature engorcement on any page mapped into memory.
- jbit 9y agoAs well as the IMA Appraisal feature that mjg59 mentioned, you can also integrity check your entire filesystem with verity[1]. Android uses it to make sure the system partition isn't tampered with. [1] https://www.kernel.org/doc/Documentation/device-mapper/verity.txt https://www.kernel.org/doc/Documentation/device-mapper/verit...
- snvzz 9y agoWhy link his personal website instead of LKML, where we could actually read the replies from Linus and other kernel devs?
- deleted 9y ago[deleted]
- deleted 9y ago[deleted]
- forgottenpass 9y ago>Overall: the patchset isn't controversial, just the way it's integrated with UEFI secure boot. The reason it's integrated with UEFI secure boot is because that's the policy most distributions want A security feature that can be circumvented in many non-secure-boot cases is still a footgun protector. And there are already plenty of those. I'm not surprised the LKML thread pushed back as hard as it did. If that's his reason for digging in his heels, then suspicion that there could be more at play doesn't seem all that unwarranted.
- tinus_hn 9y agoThe console manufacturers have a major financial stake in preventing ‘jailbreaks’ and they all have failed. There is no such stake on the PC platform and it has a legacy spanning decades. It’s really far-fetched to believe it’s anywhere near possible to secure it.
- dcow 9y agoVulns happen. It doesn't me we should just go back to sending private info in plaintext on the internet. I don't seen why user-empowered secure boot is fruitless... especially when it's to protect the user not the vendor.
- tinus_hn 9y agoSecure boot can only work if the keys are held by an untouchable entity. It’s not user-empowered. But that has nothing to do with the fact that the PC platform has an enormous legacy of openness and cannot be made secure, even if you sacrifice the parts that allowed it to dominate.
- dcow 9y agoThat's just wrong. Why do the keys have to be held by an untouchable entity? They just have to be unable to be changed outside of having physical access to the device. Stop spreading misinformation based on a shallow understanding of the technology.
- tinus_hn 9y agoI don't see how that would work on any kind of scale, but indeed you can use alternative keys if you really want to and know what you're doing.