Secure Boot, signed kernel modules (for shitvidia), and the Shim - Why does the kernel need to support SB after the handover? Can a graphics coprocessor just run as a hotpluged module unsigned?
the_sisko @ the_sisko @startrek.website Posts 2Comments 109Joined 2 yr. ago
the_sisko @ the_sisko @startrek.website
Posts
2
Comments
109
Joined
2 yr. ago
Deleted
Permanently Deleted
Deleted
Permanently Deleted
The reason is simple: in order to be a signed piece of secure boot software, the kernel needs to do everything possible to prevent unsigned code from running at the kernel's privilege level, or risk its signing key getting revoked by Microsoft.
I assume your kernel is from Fedora and is signed. If your kernel, once loaded, allowed the loading of unsigned kernel modules, then any attacker could use it as part of an exploit that allows them to break secure boot. They would simply include a copy of the Fedora kernel, and then write a custom kernel module which takes control of the machine and continues their attack. The resulting exploit could be used on any system to bypass and defeat secure boot. In essence, secure boot is only as secure as the weakest signed implementation out there.
So, Linux distributors need to demonstrate to Microsoft that they don't allow unsigned kernel code execution. Linux contains a feature called lockdown, which implements this idea. In order to be effective, lockdown must be automatically enabled by the kernel if secure boot is enabled. Interestingly, Linus flat out refuses to include the code to do that, I guess he disagrees with it. So a little discussed reality of secure boot is that, all Linux kernels which are signed have this extra patch included in order to enable lockdown during secure boot.
And that is why you can't load an unsigned module when secure boot is enabled.