4 ms·
I'm trying to figure out the order of operations here for a custom kernel. I have no doubt vendor supported Linux (Redhat, Ubuntu, etc...) will be able to work
by mbreese 15y ago
I'm trying to figure out the order of operations here for a custom kernel. I have no doubt vendor supported Linux (Redhat, Ubuntu, etc...) will be able to work around this. But what will the steps be for a custom kernel? It seems to be something like this:
1) Build kernel
2) Generate key
3) Sign kernel with key
4) Install key in UEFI key manager
But the question I have is, what do we do with the key now? Is it kept on disk? If so, does that open up a new vector for attack? A Linux virus/worm that finds the signing key, generates a new hacked kernel, signs it, and then installs itself?
I know that's a lot of steps, but then again, if a malevolent program gains root on a box, you can't really trust anything on it anymore. So I guess there isn't really anything too different about this approach, except that it may give you a false sense of security.
I'd hope that there could be some warning about booting a new kernel. Maybe something like "You are booting a new operating system 'OSName v3.1.021b' with fingerprint: AB AD C0 DE AA ..., do you wish to continue? Yes / No / Always: _ "
- sounds 15y agoIf I compile the kernel from source, I'd hope to have the choice to disable Secure Boot. (But I'll probably get a hand-me-down sony laptop and that won't be a choice.) Hopefully, the spec will require that I can install a new key. If I'm going to the effort to generate a public/private keypair, I should really save the private key on, oh, a removable drive. Then on a separate removable drive (Matthew Garrett's suggestion) I create the UEFI bootable kernel and add the public key. 1. The BIOS asks me if I want to install the new public key on the removable drive - I say yes 2. I tell the BIOS to boot from the kernel on the removable drive 3. I install the kernel and OS to the internal drive 4. Each time I reboot, the BIOS already has the new key saved, so it accepts the kernel 5. If I build a new kernel and sign it with the same key, I can install it on the internal drive or on a removable drive, and the BIOS will boot it