summaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_var_file.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2021-10-22 08:56:45 -0400
committerTom Rini <trini@konsulko.com>2021-10-22 12:43:30 -0400
commitf055f2e5a2038002519e5b9affbf259345f4ade9 (patch)
tree2388e5ea59e1e246d8f51b680d04861178f9608f /lib/efi_loader/efi_var_file.c
parent06685f9de2c1ae37cd015848d245f8a59cbc93dc (diff)
parentaf484011f12e2aa37bcf4f9cbb4258dea4ef14ac (diff)
Merge tag 'efi-2022-01-rc1' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request for efi-2022-01-rc1 Documentation: Use Sphinx 3.43. Move system reset documentation to HTML UEFI: Fix linking EFI apps with LLVM Fix alignment of loaded image Correct simple network protocol test Code cleanup
Diffstat (limited to 'lib/efi_loader/efi_var_file.c')
-rw-r--r--lib/efi_loader/efi_var_file.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/efi_loader/efi_var_file.c b/lib/efi_loader/efi_var_file.c
index c7c6805ed05..76a2ff9e412 100644
--- a/lib/efi_loader/efi_var_file.c
+++ b/lib/efi_loader/efi_var_file.c
@@ -19,6 +19,13 @@
#define PART_STR_LEN 10
+/* GUID used by Shim to store the MOK database */
+#define SHIM_LOCK_GUID \
+ EFI_GUID(0x605dab50, 0xe046, 0x4300, \
+ 0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23)
+
+static const efi_guid_t shim_lock_guid = SHIM_LOCK_GUID;
+
/**
* efi_set_blk_dev_to_system_partition() - select EFI system partition
*
@@ -175,6 +182,7 @@ efi_status_t efi_var_restore(struct efi_var_file *buf, bool safe)
if (!safe &&
(efi_auth_var_get_type(var->name, &var->guid) !=
EFI_AUTH_VAR_NONE ||
+ !guidcmp(&var->guid, &shim_lock_guid) ||
!(var->attr & EFI_VARIABLE_NON_VOLATILE)))
continue;
if (!var->length)