[RFCv2 0/9] UEFI emulator for kexec

Lennart Poettering mzxreary at 0pointer.de
Mon Sep 9 02:48:30 PDT 2024


On Fr, 06.09.24 12:54, Philipp Rudo (prudo at redhat.com) wrote:

> I mostly agree on what you have wrote. But I see a big problem in
> running the EFI emulator in user space when it comes to secure boot.
> The chain of trust ends in the kernel. So it's the kernel that needs to
> verify that the image to be loaded can be trusted. But when the EFI
> runtime is in user space the kernel simply cannot do that. Which means,
> if we want to go this way, we would need to extend the chain of trust
> to user space. Which will be a whole bucket of worms, not just a
> can.

May it would be nice to have a way to "zap" userspace away, i.e. allow
the kernel to get rid of all processes in some way, reliable. And then
simply start a new userspace, from a trusted definition. Or in other
words: if you don't want to trust the usual userspace, then let's
maybe just terminate it, and create it anew, with a clean, pristine
definition the old userspace cannot get access to.

> Let me throw an other wild idea in the ring. Instead of implementing
> a EFI runtime we could also include a eBPF version of the stub into the
> images. kexec could then extract the eBPF program and let it run just
> like any other eBPF program with all the pros (and cons) that come with
> it. That won't be as generic as the EFI runtime, e.g. you couldn't
> simply kexec any OS installer. On the other hand it would make it
> easier to port UKIs et al. to non-EFI systems. What do you think?

ebpf is not turing complete, I am not sure how far you will make it
with this, in the various implementations of EFI payloads there are
plenty of loops, sometimes IO loops, sometimes hash loops of huge data
(for measurements). As I understand ebpf is not really compatible such
code.

Lennart

--
Lennart Poettering, Berlin



More information about the kexec mailing list