summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2026-10-12 14:19:35 +0200
committerArd Biesheuvel <ardb@kernel.org>2026-10-15 13:53:08 +0200
commitda0ad36d2e95fb029c3a14ad99a78beebc29507f (patch)
tree262209a20d6054ccbaa923a1ce28dfabc41e4a12 /drivers
parenta278b88b766128e6ef5a5de0f350d897ccd14cb6 (diff)
efi: Initialize all configuration table addresses to EFI_INVALID_TABLE_ADDR
The addresses of the MOK variable table, the confidential computing secret area and the unaccepted memory table in struct efi are only initialized to EFI_INVALID_TABLE_ADDR if support for the respective table is enabled, and are left at 0 otherwise. This is harmless for the existing users, which are compiled out in that case, but code that consumes the table addresses in struct efi generically, such as a kexec loader that passes the configuration tables on to the incoming kernel, would mistake 0 for a valid table address. So initialize all of them unconditionally: efi_config_parse_tables() only assigns them if support for the table is enabled, and so they remain EFI_INVALID_TABLE_ADDR otherwise. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/firmware/efi/efi.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
index 14b9c7ebb5df..9bc22de0d67e 100644
--- a/drivers/firmware/efi/efi.c
+++ b/drivers/firmware/efi/efi.c
@@ -47,15 +47,9 @@ struct efi __read_mostly efi = {
.tpm_final_log = EFI_INVALID_TABLE_ADDR,
.ovmf_debug_log = EFI_INVALID_TABLE_ADDR,
.mem_reserve = EFI_INVALID_TABLE_ADDR,
-#ifdef CONFIG_LOAD_UEFI_KEYS
.mokvar_table = EFI_INVALID_TABLE_ADDR,
-#endif
-#ifdef CONFIG_EFI_COCO_SECRET
.coco_secret = EFI_INVALID_TABLE_ADDR,
-#endif
-#ifdef CONFIG_UNACCEPTED_MEMORY
.unaccepted = EFI_INVALID_TABLE_ADDR,
-#endif
};
EXPORT_SYMBOL(efi);