Skip to content

Commit 2278f45

Browse files
committed
Merge tag 'efi-next' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi into efi/core
Pull EFI changes for v5.5 from Ard Biesheuvel: - Change my email address to @kernel.org so I am no longer at the mercy of useless corporate email infrastructure - 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.
2 parents a99d808 + d99c1ba commit 2278f45

File tree

8 files changed

+33
-13
lines changed

8 files changed

+33
-13
lines changed

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Andy Adamson <[email protected]>
3232
Antoine Tenart <[email protected]>
3333
3434
Archit Taneja <[email protected]>
35+
3536
Arnaud Patard <[email protected]>
3637
Arnd Bergmann <[email protected]>
3738
Axel Dyks <[email protected]>

MAINTAINERS

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6003,14 +6003,14 @@ F: sound/usb/misc/ua101.c
60036003
EFI TEST DRIVER
60046004
60056005
M: Ivan Hu <[email protected]>
6006-
M: Ard Biesheuvel <ard.biesheuvel@linaro.org>
6006+
M: Ard Biesheuvel <ardb@kernel.org>
60076007
S: Maintained
60086008
F: drivers/firmware/efi/test/
60096009

60106010
EFI VARIABLE FILESYSTEM
60116011
M: Matthew Garrett <[email protected]>
60126012
M: Jeremy Kerr <[email protected]>
6013-
M: Ard Biesheuvel <ard.biesheuvel@linaro.org>
6013+
M: Ard Biesheuvel <ardb@kernel.org>
60146014
T: git git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git
60156015
60166016
S: Maintained
@@ -6189,7 +6189,7 @@ S: Supported
61896189
F: security/integrity/evm/
61906190

61916191
EXTENSIBLE FIRMWARE INTERFACE (EFI)
6192-
M: Ard Biesheuvel <ard.biesheuvel@linaro.org>
6192+
M: Ard Biesheuvel <ardb@kernel.org>
61936193
61946194
T: git git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git
61956195
S: Maintained
@@ -15006,7 +15006,7 @@ F: include/media/soc_camera.h
1500615006
F: drivers/staging/media/soc_camera/
1500715007

1500815008
SOCIONEXT SYNQUACER I2C DRIVER
15009-
M: Ard Biesheuvel <ard.biesheuvel@linaro.org>
15009+
M: Ard Biesheuvel <ardb@kernel.org>
1501015010
1501115011
S: Maintained
1501215012
F: drivers/i2c/busses/i2c-synquacer.c

arch/x86/boot/compressed/eboot.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,9 @@ efi_main(struct efi_config *c, struct boot_params *boot_params)
782782

783783
/* Ask the firmware to clear memory on unclean shutdown */
784784
efi_enable_reset_attack_mitigation(sys_table);
785+
786+
efi_random_get_seed(sys_table);
787+
785788
efi_retrieve_tpm2_eventlog(sys_table);
786789

787790
setup_graphics(boot_params);

drivers/firmware/efi/libstub/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ OBJECT_FILES_NON_STANDARD := y
3838
# Prevents link failures: __sanitizer_cov_trace_pc() is not linked in.
3939
KCOV_INSTRUMENT := n
4040

41-
lib-y := efi-stub-helper.o gop.o secureboot.o tpm.o
41+
lib-y := efi-stub-helper.o gop.o secureboot.o tpm.o \
42+
random.o
4243

4344
# include the stub's generic dependencies from lib/ when building for ARM/arm64
4445
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
4748
$(obj)/lib-%.o: $(srctree)/lib/%.c FORCE
4849
$(call if_changed_rule,cc_o_c)
4950

50-
lib-$(CONFIG_EFI_ARMSTUB) += arm-stub.o fdt.o string.o random.o \
51+
lib-$(CONFIG_EFI_ARMSTUB) += arm-stub.o fdt.o string.o \
5152
$(patsubst %.c,lib-%.o,$(arm-deps-y))
5253

5354
lib-$(CONFIG_ARM) += arm32-stub.o

drivers/firmware/efi/libstub/arm-stub.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ unsigned long efi_entry(void *handle, efi_system_table_t *sys_table,
189189
goto fail_free_cmdline;
190190
}
191191

192+
efi_retrieve_tpm2_eventlog(sys_table);
193+
192194
/* Ask the firmware to clear memory on unclean shutdown */
193195
efi_enable_reset_attack_mitigation(sys_table);
194196

drivers/firmware/efi/libstub/efistub.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ efi_status_t efi_random_alloc(efi_system_table_t *sys_table_arg,
6363

6464
efi_status_t check_platform_features(efi_system_table_t *sys_table_arg);
6565

66-
efi_status_t efi_random_get_seed(efi_system_table_t *sys_table_arg);
67-
6866
void *get_efi_config_table(efi_system_table_t *sys_table, efi_guid_t guid);
6967

7068
/* Helper macros for the usual case of using simple C variables: */

drivers/firmware/efi/libstub/random.c

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,18 @@
99

1010
#include "efistub.h"
1111

12+
typedef struct efi_rng_protocol efi_rng_protocol_t;
13+
14+
typedef struct {
15+
u32 get_info;
16+
u32 get_rng;
17+
} efi_rng_protocol_32_t;
18+
19+
typedef struct {
20+
u64 get_info;
21+
u64 get_rng;
22+
} efi_rng_protocol_64_t;
23+
1224
struct efi_rng_protocol {
1325
efi_status_t (*get_info)(struct efi_rng_protocol *,
1426
unsigned long *, efi_guid_t *);
@@ -28,7 +40,7 @@ efi_status_t efi_get_random_bytes(efi_system_table_t *sys_table_arg,
2840
if (status != EFI_SUCCESS)
2941
return status;
3042

31-
return rng->get_rng(rng, NULL, size, out);
43+
return efi_call_proto(efi_rng_protocol, get_rng, rng, NULL, size, out);
3244
}
3345

3446
/*
@@ -161,15 +173,16 @@ efi_status_t efi_random_get_seed(efi_system_table_t *sys_table_arg)
161173
if (status != EFI_SUCCESS)
162174
return status;
163175

164-
status = rng->get_rng(rng, &rng_algo_raw, EFI_RANDOM_SEED_SIZE,
165-
seed->bits);
176+
status = efi_call_proto(efi_rng_protocol, get_rng, rng, &rng_algo_raw,
177+
EFI_RANDOM_SEED_SIZE, seed->bits);
178+
166179
if (status == EFI_UNSUPPORTED)
167180
/*
168181
* Use whatever algorithm we have available if the raw algorithm
169182
* is not implemented.
170183
*/
171-
status = rng->get_rng(rng, NULL, EFI_RANDOM_SEED_SIZE,
172-
seed->bits);
184+
status = efi_call_proto(efi_rng_protocol, get_rng, rng, NULL,
185+
EFI_RANDOM_SEED_SIZE, seed->bits);
173186

174187
if (status != EFI_SUCCESS)
175188
goto err_freepool;

include/linux/efi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1645,6 +1645,8 @@ static inline void
16451645
efi_enable_reset_attack_mitigation(efi_system_table_t *sys_table_arg) { }
16461646
#endif
16471647

1648+
efi_status_t efi_random_get_seed(efi_system_table_t *sys_table_arg);
1649+
16481650
void efi_retrieve_tpm2_eventlog(efi_system_table_t *sys_table);
16491651

16501652
/*

0 commit comments

Comments
 (0)