On Tue, Nov 26, 2013 at 09:27:59AM -0500, Vivek Goyal wrote: > On Tue, Nov 26, 2013 at 04:23:36AM -0800, Eric W. Biederman wrote: > > Vivek Goyal <vgoyal at redhat.com> writes: > > > > > On Fri, Nov 22, 2013 at 07:39:14PM -0800, Eric W. Biederman wrote: > > > > > > > The init_size should be reflected in the .bss of the ELF segments. If > > not it is a bug when generating the kernel ELF headers and should be > > fixed. > > > > For use by kexec I don't see any issues with just signing the embedded > > ELF image. > > Being able to write kernel to a file and then load it feels little odd to > me. Though this should be allowed but this should not be mandatory. > > I think if we allow passing detached signature in kexec system call, then > it makes it much more flexible. We should be able to do what you are > suggesting at the same time it will also keep the possibility open for what > chromeOS developers are looking for. > Support for detached signatures would be a big plus for kexec_file_load. First I thought, some vendors are already shipping signed bzImages, why not verify these? But as it turns out, parsing MS-DOS, PE/COFF headers just to find the gaps is a lot of bloat for this little functionality. And David Howells got flamed quite badly when he suggested to add pkcs#7 to the kernel. IMO it's up to user land to search lists of certificates, and present only the final chain of trust to the kernel for checking. ELF is the preferred format for most sane OSes and firmware, and a detached signature would probably be simplest to check. If we have the choice, without restrictions from braindead boot loaders, ELF should be first. And if the pesigning isn't usable and another sig is needed anyway, why not apply that to vmlinux(.gz) ? Another remaining issue is the root of trust. Should the kernel solely depend on UeFI to check certificates? I'd rather vote for a compile-time fallback key. Torsten