Attacking the kernel via its command line
Attacking the kernel via its command line
Posted Jun 22, 2017 17:38 UTC (Thu) by pjones (subscriber, #31722)In reply to: Attacking the kernel via its command line by thestinger
Parent article: Attacking the kernel via its command line
>
> Nope, regardless of people misrepresenting it as such, that doesn't
> change that it's not. No bugs are required to take control of everything
> via the kernel line, and that includes kernel code execution.
In the Secure Boot context, this doesn't happen to be the case. The intent is that when SB is enabled, all command line options that would give you a mechanism to break out and effectively use the loaded OS as a bootloader for an untrusted kernel are disabled.
Since this potentially allows arbitrary untrusted code execution from the kernel's privilege level, it's a real vuln in the context of the Secure Boot threat model. From a practical point of view, that means you can use it to build and install a bootkit that persists across OS reinstalls. So yes, it really is a potential Secure Boot bypass, and yes it does actually matter for normal deployment of normal systems.
> This doesn't mean anything if even init wasn't verified. There's
> not really anything further to compromise. If the kernel contains
> root with SELinux or whatever else, then protecting the kernel
> from root has value. I'm not sure what the connection is to
> secure / verified boot though.
What Secure Boot is giving you is the ability to recover from being rooted by an attacker who's actually moderately competent. This bypasses our ability to ensure that, because you can run untrusted kernel code, and therefore you can use a signed bootloader+kernel to launch untrusted kernel code. You can effectively organize that code as a bootloader for what looks like a normal OS, except with a loader that modifies whatever it wants however it wants. With fairly minimal effort, this means a perpetual back door that remains open across kernel upgrades. With a little more effort you can make that continue being true when you boot new install media.
There are several different ways you can accomplish that, some more insidious than others, and there are various bells and whistles that are more effort on top of that, including how hard you want to hide that you're doing it. But those are bells and whistles. Basic exploits of this type have been seen in the wild, and these are what Secure Boot prevents. And talks at security conferences now regularly include methods to do all of this, with the stipulation that Secure Boot must be disabled. This bug gives you a mechanism to build it again with Secure Boot enabled. That's what this has to do with Secure Boot.
What it has to do with "verified boot" or "trusted boot" is nothing at all.
