Skip to contentSkip to conversation

EFI updates for v5.5

GIT PULL Merged Ingo Molnar 2 participants 2 messages Nov 25, 2019 – Nov 27, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Linus,

Please pull the latest efi-core-for-linus git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git efi-core-for-linus

# HEAD: 2278f452a12d5b5b01f96441a7a4336710365022 Merge tag 'efi-next' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi into efi/core

The main changes in this cycle were:

- Wire up the EFI RNG code for x86. This enables an additional source of entropy during early boot.

- Enable the TPM event log code on ARM platforms.

- Update Ard's email address.

Thanks,

Ingo

------------------>
Ard Biesheuvel (1):
MAINTAINERS: update Ard's email address to @kernel.org

Dominik Brodowski (2):
efi/random: use arch-independent efi_call_proto()
x86: efi/random: Invoke EFI_RNG_PROTOCOL to seed the UEFI RNG table

Xinwei Kong (1):
efi: libstub/tpm: enable tpm eventlog function for ARM platforms

 .mailmap                                |  1 +
 MAINTAINERS                             |  8 ++++----
 arch/x86/boot/compressed/eboot.c        |  3 +++
 drivers/firmware/efi/libstub/Makefile   |  5 +++--
 drivers/firmware/efi/libstub/arm-stub.c |  2 ++
 drivers/firmware/efi/libstub/efistub.h  |  2 --
 drivers/firmware/efi/libstub/random.c   | 23 ++++++++++++++++++-----
 include/linux/efi.h                     |  2 ++
 8 files changed, 33 insertions(+), 13 deletions(-)
.mailmap +1 -0
index 83d7e750c2fc..5d3b741a3f95 100644
@@ -32,6 +32,7 @@ Andy Adamson <[email protected]>
 Antoine Tenart <[email protected]>
 Antonio Ospite <[email protected]> <[email protected]>
 Archit Taneja <[email protected]>
+Ard Biesheuvel <[email protected]> <[email protected]>
 Arnaud Patard <[email protected]>
 Arnd Bergmann <[email protected]>
 Axel Dyks <[email protected]>
MAINTAINERS +4 -4
index cba1095547fd..cc9f02ab9316 100644
@@ -6003,14 +6003,14 @@ F:	sound/usb/misc/ua101.c
 EFI TEST DRIVER
 L:	[email protected]
 M:	Ivan Hu <[email protected]>
-M:	Ard Biesheuvel <[email protected]>
+M:	Ard Biesheuvel <[email protected]>
 S:	Maintained
 F:	drivers/firmware/efi/test/
 
 EFI VARIABLE FILESYSTEM
 M:	Matthew Garrett <[email protected]>
 M:	Jeremy Kerr <[email protected]>
-M:	Ard Biesheuvel <[email protected]>
+M:	Ard Biesheuvel <[email protected]>
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git
 L:	[email protected]
 S:	Maintained
@@ -6189,7 +6189,7 @@ S:	Supported
 F:	security/integrity/evm/
 
 EXTENSIBLE FIRMWARE INTERFACE (EFI)
-M:	Ard Biesheuvel <[email protected]>
+M:	Ard Biesheuvel <[email protected]>
 L:	[email protected]
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git
 S:	Maintained
@@ -15006,7 +15006,7 @@ F:	include/media/soc_camera.h
 F:	drivers/staging/media/soc_camera/
 
 SOCIONEXT SYNQUACER I2C DRIVER
-M:	Ard Biesheuvel <[email protected]>
+M:	Ard Biesheuvel <[email protected]>
 L:	[email protected]
 S:	Maintained
 F:	drivers/i2c/busses/i2c-synquacer.c
arch/x86/boot/compressed/eboot.c +3 -0
index 82bc60c8acb2..68945c5700bf 100644
@@ -782,6 +782,9 @@ efi_main(struct efi_config *c, struct boot_params *boot_params)
 
 	/* Ask the firmware to clear memory on unclean shutdown */
 	efi_enable_reset_attack_mitigation(sys_table);
+
+	efi_random_get_seed(sys_table);
+
 	efi_retrieve_tpm2_eventlog(sys_table);
 
 	setup_graphics(boot_params);
drivers/firmware/efi/libstub/Makefile +3 -2
index ee0661ddb25b..c35f893897e1 100644
@@ -38,7 +38,8 @@ OBJECT_FILES_NON_STANDARD	:= y
 # Prevents link failures: __sanitizer_cov_trace_pc() is not linked in.
 KCOV_INSTRUMENT			:= n
 
-lib-y				:= efi-stub-helper.o gop.o secureboot.o tpm.o
+lib-y				:= efi-stub-helper.o gop.o secureboot.o tpm.o \
+				   random.o
 
 # include the stub's generic dependencies from lib/ when building for ARM/arm64
 arm-deps-y := fdt_rw.c fdt_ro.c fdt_wip.c fdt.c fdt_empty_tree.c fdt_sw.c
@@ -47,7 +48,7 @@ arm-deps-$(CONFIG_ARM64) += sort.c
 $(obj)/lib-%.o: $(srctree)/lib/%.c FORCE
 	$(call if_changed_rule,cc_o_c)
 
-lib-$(CONFIG_EFI_ARMSTUB)	+= arm-stub.o fdt.o string.o random.o \
+lib-$(CONFIG_EFI_ARMSTUB)	+= arm-stub.o fdt.o string.o \
 				   $(patsubst %.c,lib-%.o,$(arm-deps-y))
 
 lib-$(CONFIG_ARM)		+= arm32-stub.o
drivers/firmware/efi/libstub/arm-stub.c +2 -0
index c382a48c6678..817237ce2420 100644
@@ -189,6 +189,8 @@ unsigned long efi_entry(void *handle, efi_system_table_t *sys_table,
 		goto fail_free_cmdline;
 	}
 
+	efi_retrieve_tpm2_eventlog(sys_table);
+
 	/* Ask the firmware to clear memory on unclean shutdown */
 	efi_enable_reset_attack_mitigation(sys_table);
 
drivers/firmware/efi/libstub/efistub.h +0 -2
index 7f1556fd867d..05739ae013c8 100644
@@ -63,8 +63,6 @@ efi_status_t efi_random_alloc(efi_system_table_t *sys_table_arg,
 
 efi_status_t check_platform_features(efi_system_table_t *sys_table_arg);
 
-efi_status_t efi_random_get_seed(efi_system_table_t *sys_table_arg);
-
 void *get_efi_config_table(efi_system_table_t *sys_table, efi_guid_t guid);
 
 /* Helper macros for the usual case of using simple C variables: */
drivers/firmware/efi/libstub/random.c +18 -5
index b4b1d1dcb5fd..53f1466f7de6 100644
@@ -9,6 +9,18 @@
 
 #include "efistub.h"
 
+typedef struct efi_rng_protocol efi_rng_protocol_t;
+
+typedef struct {
+	u32 get_info;
+	u32 get_rng;
+} efi_rng_protocol_32_t;
+
+typedef struct {
+	u64 get_info;
+	u64 get_rng;
+} efi_rng_protocol_64_t;
+
 struct efi_rng_protocol {
 	efi_status_t (*get_info)(struct efi_rng_protocol *,
 				 unsigned long *, efi_guid_t *);
@@ -28,7 +40,7 @@ efi_status_t efi_get_random_bytes(efi_system_table_t *sys_table_arg,
 	if (status != EFI_SUCCESS)
 		return status;
 
-	return rng->get_rng(rng, NULL, size, out);
+	return efi_call_proto(efi_rng_protocol, get_rng, rng, NULL, size, out);
 }
 
 /*
@@ -161,15 +173,16 @@ efi_status_t efi_random_get_seed(efi_system_table_t *sys_table_arg)
 	if (status != EFI_SUCCESS)
 		return status;
 
-	status = rng->get_rng(rng, &rng_algo_raw, EFI_RANDOM_SEED_SIZE,
-			      seed->bits);
+	status = efi_call_proto(efi_rng_protocol, get_rng, rng, &rng_algo_raw,
+				 EFI_RANDOM_SEED_SIZE, seed->bits);
+
 	if (status == EFI_UNSUPPORTED)
 		/*
 		 * Use whatever algorithm we have available if the raw algorithm
 		 * is not implemented.
 		 */
-		status = rng->get_rng(rng, NULL, EFI_RANDOM_SEED_SIZE,
-				      seed->bits);
+		status = efi_call_proto(efi_rng_protocol, get_rng, rng, NULL,
+					 EFI_RANDOM_SEED_SIZE, seed->bits);
 
 	if (status != EFI_SUCCESS)
 		goto err_freepool;
include/linux/efi.h +2 -0
index d87acf62958e..028efa7a9f3b 100644
@@ -1645,6 +1645,8 @@ static inline void
 efi_enable_reset_attack_mitigation(efi_system_table_t *sys_table_arg) { }
 #endif
 
+efi_status_t efi_random_get_seed(efi_system_table_t *sys_table_arg);
+
 void efi_retrieve_tpm2_eventlog(efi_system_table_t *sys_table);
 
 /*
merge bot Merged
#1 lore raw
The pull request you sent on Mon, 25 Nov 2019 12:04:15 +0100:

The pull request you sent on Mon, 25 Nov 2019 12:04:15 +0100:

Quoted 1 line

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git efi-core-for-linus

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/df28204bb0f29cc475c0a8893c99b46a11a4903f

Thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/prtracker