Skip to content

Commit 0bf913e

Browse files
committed
Merge tag 'efi-fixes-for-v6.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi
Pull EFI fixes from Ard Biesheuvel: - avoid a potential crash on the efi_subsys_init() error path - use more appropriate error code for runtime services calls issued after a crash in the firmware occurred - avoid READ_ONCE() for accessing firmware tables that may appear misaligned in memory * tag 'efi-fixes-for-v6.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi: efi: tpm: Avoid READ_ONCE() for accessing the event log efi: rt-wrapper: Add missing include efi: fix userspace infinite retry read efivars after EFI runtime services page fault efi: fix NULL-deref in init error path
2 parents 40d92fc + d3f4505 commit 0bf913e

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

arch/arm64/kernel/efi-rt-wrapper.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55

66
#include <linux/linkage.h>
7+
#include <asm/assembler.h>
78

89
SYM_FUNC_START(__efi_rt_asm_wrapper)
910
stp x29, x30, [sp, #-112]!

drivers/firmware/efi/efi.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,8 @@ static int __init efisubsys_init(void)
394394
efi_kobj = kobject_create_and_add("efi", firmware_kobj);
395395
if (!efi_kobj) {
396396
pr_err("efi: Firmware registration failed.\n");
397-
destroy_workqueue(efi_rts_wq);
398-
return -ENOMEM;
397+
error = -ENOMEM;
398+
goto err_destroy_wq;
399399
}
400400

401401
if (efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE |
@@ -443,7 +443,10 @@ static int __init efisubsys_init(void)
443443
err_put:
444444
kobject_put(efi_kobj);
445445
efi_kobj = NULL;
446-
destroy_workqueue(efi_rts_wq);
446+
err_destroy_wq:
447+
if (efi_rts_wq)
448+
destroy_workqueue(efi_rts_wq);
449+
447450
return error;
448451
}
449452

drivers/firmware/efi/runtime-wrappers.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ struct efi_runtime_work efi_rts_work;
6262
\
6363
if (!efi_enabled(EFI_RUNTIME_SERVICES)) { \
6464
pr_warn_once("EFI Runtime Services are disabled!\n"); \
65+
efi_rts_work.status = EFI_DEVICE_ERROR; \
6566
goto exit; \
6667
} \
6768
\

include/linux/tpm_eventlog.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ static __always_inline int __calc_tpm2_event_size(struct tcg_pcr_event2_head *ev
198198
* The loop below will unmap these fields if the log is larger than
199199
* one page, so save them here for reference:
200200
*/
201-
count = READ_ONCE(event->count);
202-
event_type = READ_ONCE(event->event_type);
201+
count = event->count;
202+
event_type = event->event_type;
203203

204204
/* Verify that it's the log header */
205205
if (event_header->pcr_idx != 0 ||

0 commit comments

Comments
 (0)