Skip to content

Conversation

@jsetje
Copy link
Collaborator

@jsetje jsetje commented Aug 20, 2024

These proposed changes are ready for comments, especially around the naming. Some XXX's in the commit comments.

These are all pretty simple changes, I've not included the SbatLevel index in dbx which isn't pretty (yet).

@jsetje jsetje requested a review from hughsie August 20, 2024 00:07
shim.c Outdated

efi_status = read_image(image_handle, L"revocations.efi", &PathName,
efi_status = read_image(image_handle, L"revocations_sbat.efi", &PathName,
&data, &datasize,
Copy link

Choose a reason for hiding this comment

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

are you missing a check for efi_status here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for catching that!! Yes, kind of. If they both fail, then we should bail out. Fixing...

shim.c Outdated
while (load_cert_file(image_handle, FileName, PathName,
SUPPRESS_NETBOOT_OPEN_FAILURE_NOISE)
== EFI_SUCCESS && i++ < 10) {
FileName[17]++;
Copy link

Choose a reason for hiding this comment

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

I think it's going to be confusing having to rename shim_certificate_sbat.efi to shim_certificate_0.efi, shim_certificate_ski.efi to shim_certificate_1.efi etc. Can't we just use those names?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For the netboot case we can't do a reddir. So fining something like shim_certificate_<vendor_name>.efi would require an awful lot permutations to try, and I really don't think that's the right thing to do.

So I'm putting it on whoever deploys the netboot config to deal with renaming or linking. It's not wonderful, but does seem better to have this flexibility in place.

Copy link
Collaborator Author

@jsetje jsetje Feb 4, 2025

Choose a reason for hiding this comment

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

Also, I put that loop in the wrong failure path. Fixing now that I'm doing the full testing. (Adding this comment now, in case the next force push makes this hard to understand)

@vathpela vathpela added this to the shim 16 milestone Jan 9, 2025
@jsetje jsetje force-pushed the revocations_v3 branch 2 times, most recently from b121552 to 4d4f2ed Compare January 21, 2025 04:28
@jsetje jsetje marked this pull request as ready for review January 21, 2025 04:36
@jsetje
Copy link
Collaborator Author

jsetje commented Jan 21, 2025

I should re-test some of the failure variations. I'll make a note here when that's done.

I'm explicitly not including sbat level in dbx since, while it's a neat way to deliver revocations without a reboot, it also seems like a great way to make a mistake that can't be undone.

@jsetje jsetje marked this pull request as draft February 4, 2025 21:32
@jsetje jsetje force-pushed the revocations_v3 branch 3 times, most recently from 398b5a2 to 571bbcb Compare February 5, 2025 07:43
@jsetje jsetje marked this pull request as ready for review February 5, 2025 07:46
@jsetje jsetje force-pushed the revocations_v3 branch 3 times, most recently from 63e7951 to cbfd422 Compare February 10, 2025 23:30
Reading files during a netboot comes with the caveat that
fetching files from a network does not support anything
like listing a directory. In the past this has meant that
we do not try to open optional files during a netboot.
However at least the revocation.efi file is now tested
during a netboot, which will print an error when it is not
found. Since that error is spurious we should allow for
those errors to be suppressed.

This is also desirable since we will likely go looking for
additional files in the near future.

Signed-off-by: Jan Setje-Eilers <Jan.SetjeEilers@oracle.com>
Bugfix: In the netboot case revocations.efi files were read, but
processed as shim_certificate.efi files which is simply wrong.

Signed-off-by: Jan Setje-Eilers <Jan.SetjeEilers@oracle.com>
While a revocations.efi binary can contain either SBAT revocations,
SkuSi revocations, or both, it is desirable to package them separately
so that higher level tools such as fwupd can decide which ones to put
in place at a given moment. This changes revocations.efi to
revocations_sbat.efi and revocations_sku.efi

Signed-off-by: Jan Setje-Eilers <Jan.SetjeEilers@oracle.com>
Since we can't read the directory, we can try to load
shim_certificate_[0..9].efi explicitly and give up after
the first one that fails to load.

Signed-off-by: Jan Setje-Eilers <Jan.SetjeEilers@oracle.com>
@vathpela vathpela merged commit 6b8e40c into rhboot:main Feb 18, 2025
20 checks passed
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.

4 participants