summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Setje-Eilers <jan.setjeeilers@oracle.com>2023-12-15 14:49:04 -0800
committerPeter Jones <pjones@redhat.com>2024-01-22 14:17:20 -0500
commit993a345dc3657d47f0e5e1c55cfddfd5f9866053 (patch)
tree68428cf462c142724cd7d3d976142d213be6754f
parenta23e2f0de7a61b6e895a915676eba3a1fda2cd78 (diff)
downloadefi-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.h2
-rw-r--r--shim.c9
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 {
diff --git a/shim.c b/shim.c
index fd196cd9..633163a0 100644
--- a/shim.c
+++ b/shim.c
@@ -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,