Secure boot signing for btrfs-efi #12300

Open
opened 2024-09-03 03:05:09 +00:00 by dcavalca · 18 comments
Contributor

We'd like to add btrfs-efi to the build channel for official signatures: https://src.fedoraproject.org/rpms/btrfs-efi . btrfs-efi is a btrfs filesystem driver for EFI; among other things, it would make it easier to properly support /boot on btrfs for secureboot-enabled systems.

We'd like to add btrfs-efi to the build channel for official signatures: https://src.fedoraproject.org/rpms/btrfs-efi . `btrfs-efi` is a btrfs filesystem driver for EFI; among other things, it would make it easier to properly support `/boot` on btrfs for secureboot-enabled systems.
Author
Contributor
cc @ngompa @salimma
Member

Here's a sample spec for btrfs-efi-signed that pulls the btrfs-efi binary RPMs as inputs: https://pagure.io/btrfs-efi-signed/blob/main/f/btrfs-efi-signed.spec

Here's a sample spec for btrfs-efi-signed that pulls the btrfs-efi binary RPMs as inputs: https://pagure.io/btrfs-efi-signed/blob/main/f/btrfs-efi-signed.spec
Member

cc: @davdunc @dbrandonjohnson

cc: @davdunc @dbrandonjohnson
Owner

I don't think we can currently do this due to issues with the current secureboot signing setup.

We are working on reworking it, but it's not in place yet.

See https://pagure.io/releng/issue/10765 for the systemd-boot ticket.

CC: @pjones @rharwood

I don't think we can currently do this due to issues with the current secureboot signing setup. We are working on reworking it, but it's not in place yet. See https://pagure.io/releng/issue/10765 for the systemd-boot ticket. CC: @pjones @rharwood
Member

Is there a change associated with this?

Is there a change associated with this?
Author
Contributor

Not yet, but we can definitely put one up if it's useful.

Not yet, but we can definitely put one up if it's useful.

Can someone explain the workflow they see this being used in?

Can someone explain the workflow they see this being used in?
Member

The idea is that this would be used by EFI boot managers to be able to read a Btrfs volume, similar to what would be possible if you used edk2-ext4 to make UEFI boot managers read Ext2/3/4 volumes.

In particular, the idea is to combine it with boot managers like systemd-boot or rEFInd (which can automatically load the drivers if they're installed in a specific location on the ESP) so that they can (mostly transparently) access them like VFAT (or HFS+/APFS on Intel Macs).

The idea is that this would be used by EFI boot managers to be able to read a Btrfs volume, similar to what would be possible if you used `edk2-ext4` to make UEFI boot managers read Ext2/3/4 volumes. In particular, the idea is to combine it with boot managers like systemd-boot or rEFInd (which can automatically load the drivers if they're installed in a specific location on the ESP) so that they can (mostly transparently) access them like VFAT (or HFS+/APFS on Intel Macs).

What do you expect to load this driver? Right now there aren't any EFI systems where a driver loader even trusts a signature we'd put on it. I'm not seeing how Fedora signing it helps with what you're suggesting.

Additionally before we'd consider this okay, even if our signatures did carry weight with the EFI driver loaders, it would need to support .sbat revocations and have a self-test to check for its own revocation.

What do you expect to load this driver? Right now there aren't any EFI systems where a driver loader even trusts a signature we'd put on it. I'm not seeing how Fedora signing it helps with what you're suggesting. Additionally before we'd consider this okay, even if our signatures *did* carry weight with the EFI driver loaders, it would need to support .sbat revocations and have a self-test to check for its own revocation.
Member

What do you expect to load this driver? Right now there aren't any EFI systems where a driver loader even trusts a signature we'd put on it. I'm not seeing how Fedora signing it helps with what you're suggesting.

I would expect our boot manager to load it. And that would already trust our signature.

Additionally before we'd consider this okay, even if our signatures did carry weight with the EFI driver loaders, it would need to support .sbat revocations and have a self-test to check for its own revocation.

I can add sbat data to the binaries easily enough, I suppose.

> What do you expect to load this driver? Right now there aren't any EFI systems where a driver loader even trusts a signature we'd put on it. I'm not seeing how Fedora signing it helps with what you're suggesting. > I would expect our boot manager to load it. And that would already trust our signature. > Additionally before we'd consider this okay, even if our signatures *did* carry weight with the EFI driver loaders, it would need to support .sbat revocations and have a self-test to check for its own revocation. I can add sbat data to the binaries easily enough, I suppose.

Currently we don't have an EFI driver loader in any of our bootloaders.

Currently we don't have an EFI driver loader in any of our bootloaders.
Member

I would expect our boot manager to load it. And that would already trust our signature.

Normally EFI drivers are loaded by the EFI firmware, even if prompted to be loaded by a bootmgr, which means it uses the EFI infrastructure for things like verification so it would need to be signed by a key supported by the firmware which in most cases I believe it would be the MS key like shim is signed by.

> I would expect our boot manager to load it. And that would already trust our signature. Normally EFI drivers are loaded by the EFI firmware, even if prompted to be loaded by a bootmgr, which means it uses the EFI infrastructure for things like verification so it would need to be signed by a key supported by the firmware which in most cases I believe it would be the MS key like shim is signed by.
Member

Maybe not grub, but systemd-boot does. It'll load drivers installed into \EFI\systemd\drivers. As for rEFInd, it can load any that it is told to load via its configuration file stored on the ESP.

Maybe not grub, but systemd-boot does. It'll load drivers installed into `\EFI\systemd\drivers`. As for rEFInd, it can load any that it is told to load via its configuration file stored on the ESP.

Metadata Update from @phsmoura:

  • Issue tagged with: high-trouble, low-gain, ops
**Metadata Update from @phsmoura**: - Issue tagged with: high-trouble, low-gain, ops
Member

Since we now have the infrastructure to support this for all EFI arches, can folks please look at making this work?

Since we now have the infrastructure to support this for all EFI arches, can folks please look at making this work?
Owner

So, the use here would be systemd-boot -> btrfs-efi?
Then we should sign it with the same ca as systemd-boot right?

So, the use here would be systemd-boot -> btrfs-efi? Then we should sign it with the same ca as systemd-boot right?
Member

Currently yes, though it would be also useful for rEFInd and Sprout as well. Basically any UEFI boot manager can use it. Maybe it would make sense to have a "Fedora EFI driver CA" that shim trusts?

Currently yes, though it would be also useful for rEFInd and Sprout as well. Basically any UEFI boot manager can use it. Maybe it would make sense to have a "Fedora EFI driver CA" that shim trusts?
Member

Insofar as SBAT stuff, @maharmstone is the developer of btrfs-efi and @dcavalca and I can talk to him about that. I'm not familiar enough with EFI driver applications to know how SBAT works with that.

Insofar as SBAT stuff, @maharmstone is the developer of btrfs-efi and @dcavalca and I can talk to him about that. I'm not familiar enough with EFI driver applications to know how SBAT works with that.
Sign in to join this conversation.
No milestone
No project
No assignees
6 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
releng/tickets#12300
No description provided.