diff options
| author | Jan Setje-Eilers <jan.setjeeilers@oracle.com> | 2023-12-15 14:49:04 -0800 |
|---|---|---|
| committer | Peter Jones <pjones@redhat.com> | 2024-01-22 14:17:20 -0500 |
| commit | 993a345dc3657d47f0e5e1c55cfddfd5f9866053 (patch) | |
| tree | 68428cf462c142724cd7d3d976142d213be6754f | |
| parent | a23e2f0de7a61b6e895a915676eba3a1fda2cd78 (diff) | |
| download | efi-boot-shim-993a345dc3657d47f0e5e1c55cfddfd5f9866053.tar.gz efi-boot-shim-993a345dc3657d47f0e5e1c55cfddfd5f9866053.zip | |
Try to load revocations.efi even if directory read fails
Network booting tends to expose things like a tfpt server
as a filesystem that doesn't implement directory listing
This will blindly try to ingest a revocations.efi file in
those cases, even if that may result in some console noise
when the file does not exist.
Signed-off-by: Jan Setje-Eilers <Jan.SetjeEilers@oracle.com>
| -rw-r--r-- | include/sbat.h | 2 | ||||
| -rw-r--r-- | shim.c | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/include/sbat.h b/include/sbat.h index 4be0cbb1..bb523e7e 100644 --- a/include/sbat.h +++ b/include/sbat.h @@ -38,6 +38,8 @@ #define POLICY_RESET 3 #define POLICY_NOTREAD 255 +#define REVOCATIONFILE L"revocations.efi" + extern UINTN _sbat, _esbat; struct sbat_var_entry { @@ -1590,6 +1590,13 @@ load_unbundled_trust(EFI_HANDLE image_handle) if (EFI_ERROR(efi_status)) { dprint(L"Failed to find fs on local drive (netboot?): %r \n", efi_status); + /* + * Network boot cases do not support reading a directory. Try + * to read revocations.efi to pull in any unbundled SBATLevel + * updates unconditionally in those cases. This may produce + * console noise when the file is not present. + */ + load_cert_file(image_handle, REVOCATIONFILE, PathName); goto done; } @@ -1668,7 +1675,7 @@ load_unbundled_trust(EFI_HANDLE image_handle) * revocations.efi file then to search for shim_certificate.efi */ if (search_revocations && - StrCaseCmp(info->FileName, L"revocations.efi") == 0) { + StrCaseCmp(info->FileName, REVOCATIONFILE) == 0) { load_revocations_file(image_handle, PathName); search_revocations = FALSE; efi_status = root->Open(root, &dir, PathName, |
