197 points · by zdw · 8y ago · 129 comments
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.
Now, this only really makes sense if you are in some sort of trusted untampered environment already: if not, someone with root can stomp a new kernel in /boot/ which gives them a backdoor. So, lockdown without a trusted boot environment is security theater, since you can just take the long road anyway.
Additionally, in a trusted boot environment, the lockdown flag is wanted. If not, "trusted boot" really isn't such: someone that booted through a signed kernel can simply tamper with the kernel anyway after booting up through an init hook. The dangerous part: once they have the ability to tamper with the kernel, they can chainload another operating system and functional as a poisonous bootloader. The danger here is that if an attack like this is seen in the wild, and the attacker used, say, Fedora's kernel signing keys to do the attack, it has the possibility to get Fedora's keys blacklisted by OEMs. Linux would do best not to be used by an attacker as a "malware bootloader".
That means it's reasonable for, by default, lockdown to be informed by the presence of a trusted boot environment.
And just like that it stops being a magically enabled thing and becomes something you have to either have fully on or fully off.
These protections should vastly reduce the risks of someone gaining root and make it much harder to do so to a running system with physical access. Or?
Seems to me that it is just as much security theater to pretend that it isn't game over if someone already has root.
edit: and perhaps the (by far?) biggest benefit of lockdown is to make it harder for someone to gain root?
Here's the bit I don't get: even if you can't be used as a chainloading malware bootloader, can't you still be used as a slightly more complicated malware bootloader that fires up the victim OS under virtualisation?
Exactly, and that's why lockdown and secure boot must be discarded. These are attempts to take control away from the user and give it to the OS maker or device manufacturer. This is exactly why I cannot root my android without losing hardware features and this is exactly why ios devices are not general purpose computers.
Fuck these anti-user efforts. They have no place in Linux.
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.
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 :)
'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
Somewhat annoyingly this puts me in a quandary, remove the incorrect top level post, thus the history in which the error was highlighted.
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.
[1] https://www.kernel.org/doc/Documentation/device-mapper/verit...
The security features of android are the best argument for the stance Linus takes on these things.
Hmm does this only apply to files though? I'm talking about kernel signature engorcement on any page mapped into memory.
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
Also, I am not sure about it adding no security without verified boot - a machine rebooting is something that can be noticed.
And the /r/linux discussion from earlier: https://www.reddit.com/r/linux/comments/89mtyt/linus_torvald...
Will this parchset get merged?
> 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
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 which was linked elsewhere in the comments here.
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.
Edit: *Eventually
Considering Linus has been arguing in favor of the value of lockdown in lieu of SecureBoot he's obviously on-board with the patchset conceptually. The problem seems to be in how SecureBoot and lockdown are currently related in the implementation when he's arguing they're entirely independent of one another. The things just fall apart in the communications.
Except for it being tied to UEFI boot.
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.
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 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.
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.
It’s really far-fetched to believe it’s anywhere near possible to secure it.
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.
[1] https://en.wikipedia.org/wiki/Secure_cryptoprocessor
[2] https://en.wikipedia.org/wiki/Code_signing
[3] https://en.wikipedia.org/wiki/PlayStation_Portable_homebrew
https://en.wikipedia.org/wiki/PlayStation_3_homebrew
https://fail0verflow.com/blog/2014/console-hacking-2013-omak...
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.
Not without Secure Boot.
Really... why would I as user not want it?
https://community.amd.com/community/amd-corporate/blog/2018/...
https://blog.trailofbits.com/2018/03/15/amd-flaws-technical-...