History

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

Linus Torvalds committed 3 years ago

Commit 0bf913e2 parents 40d92fc d3f45054 files · +10 −5Browse files

Unified · Split

4 files
  1. arch/arm64/kernel/efi-rt-wrapper.S +1 −0
  2. drivers/firmware/efi/efi.c +6 −3
  3. drivers/firmware/efi/runtime-wrappers.c +1 −0
  4. include/linux/tpm_eventlog.h +2 −2
arch/arm64/kernel/efi-rt-wrapper.S+1−0
@@ -4,6 +4,7 @@ · 3 unmodified lines
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+6−3
@@ -394,8 +394,8 @@ static int __init efisubsys_init(void) · 393 unmodified lines
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 @@ err_unregister: · 41 unmodified lines
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+1−0
@@ -62,6 +62,7 @@ struct efi_runtime_work efi_rts_work; · 61 unmodified lines
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+2−2
@@ -198,8 +198,8 @@ static __always_inline int __calc_tpm2_event_size(struct tcg_pcr_event2_head *ev · 197 unmodified lines
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 ||

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t