Skip to content

WIP: UKI+systemdboot pcr4 predictions#78

Draft
bgartzi wants to merge 11 commits into
trusted-execution-clusters:mainfrom
bgartzi:systemdboot
Draft

WIP: UKI+systemdboot pcr4 predictions#78
bgartzi wants to merge 11 commits into
trusted-execution-clusters:mainfrom
bgartzi:systemdboot

Conversation

@bgartzi

@bgartzi bgartzi commented May 4, 2026

Copy link
Copy Markdown
Contributor

Very slightly tested. Don't rely on this at this stage by any means.
Depends on #33

@bgartzi bgartzi marked this pull request as draft May 4, 2026 15:00
@bgartzi bgartzi force-pushed the systemdboot branch 3 times, most recently from 5a55b14 to 75a2ebf Compare May 5, 2026 14:56
Comment thread lib/src/rootfs.rs Outdated
Comment thread lib/src/rootfs.rs Outdated
Comment thread lib/src/tpmevents.rs
Comment on lines +72 to +73
//TODO: should we create another TPMEG_ for systemdboot?
TPMEventID::Pcr4SystemdBoot => TPMEG_BOOTLOADER,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if we really need to distinguish things here. They should all behave the same for PCR computation?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you refer to systemdboot from shim/grub? Are you referring to uki/addons and linux too? Could you elaborate your concern a bit more?

I really need to consider how this gears into the combine logic. I just mocked the "I'm running shim/grub and I upgrade into systemdboot" case but did not result in what I'd expect... combine.rs probably needs yet another tweak (or two).

@travier

travier commented Jun 2, 2026

Copy link
Copy Markdown
Member

We'll need to figure out how to offer an interface to measure all UKI addons (to generate metadata for example) but only include some for the PCR computation.

bgartzi added 5 commits June 8, 2026 14:58
Some images might boot from an UKI. By default, it will be located under
/boot/EFI/Linux/uki.efi in fedora images. If the user provides another
path, that will preceed over it.

Now, when new rootfs are created it will check if the user-provided or
the default UKI exists. If it does, it will fill the uki + addon fields
of the rootfs struct.

Later, we can retrieve those. uki returns an Option<String> to know if
it is or not a uki image.

Signed-off-by: Beñat Gartzia Arruabarrena <bgartzia@redhat.com>
Signed-off-by: Beñat Gartzia Arruabarrena <bgartzia@redhat.com>
PCR computation for PCR4 with uki or without it was not so different.
The only thing that changes is part related to vmlinuz or the UKI.

Merge both of them, as we can know which of the cases we are dealing
with easily, based on whether the UKI was found in the expected path or
not.

Signed-off-by: Beñat Gartzia Arruabarrena <bgartzia@redhat.com>
Admit paths to the UKI and its addons.

Signed-off-by: Beñat Gartzia Arruabarrena <bgartzia@redhat.com>
Now users can pass uki and uki addons paths to the compute-pcrs binary.
Now, the binary will assume that it is predicting PCRs for an UKI image.
It will try to find the UKI image in the path provided by the user. If
it was not provided, it will try finding it in the default path. It it
was not found even there, then it will assume it is the legacy case and
will compute pcr4 as it was done until now.

Signed-off-by: Beñat Gartzia Arruabarrena <bgartzia@redhat.com>
bgartzi added 4 commits June 8, 2026 15:35
Find systemd-boot efi file if any and let others know whether it exists
or not.

Signed-off-by: Beñat Gartzia Arruabarrena <bgartzia@redhat.com>
Not there yet. We need to figure out which TPMEG this event should
really use. We need to discuss how would this behave in upgrade
scenarios.

Signed-off-by: Beñat Gartzia Arruabarrena <bgartzia@redhat.com>
For a very specific case, see:
https://github.com/trusted-execution-clusters/fedora-coreos-uki

Signed-off-by: Beñat Gartzia Arruabarrena <bgartzia@redhat.com>
Signed-off-by: Beñat Gartzia Arruabarrena <bgartzia@redhat.com>
@bgartzi

bgartzi commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

We'll need to figure out how to offer an interface to measure all UKI addons (to generate metadata for example) but only include some for the PCR computation.

The user (or the system using this as a tool) can filter the UKI addons that should go into pcr4 and just pass those to the tool.

What is that metadata for? What does it need, the authenticode hash of each of the addons? I guess we could add another command that could create that kind of information receiving the full list of addons?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants