Skip to content

Commit b63f4a4

Browse files
committed
Merge tag 'efi-fixes-for-v6.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi
Pull EFI fixes from Ard Biesheuvel: "A couple of fixes for EFI regressions introduced this cycle: - Make EDID handling in the EFI stub mixed mode safe - Ensure that efi_mm.user_ns has a sane value - this is needed now that EFI runtime calls are preemptible on arm64" * tag 'efi-fixes-for-v6.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi: kthread: Warn if mm_struct lacks user_ns in kthread_use_mm() arm64: efi: Fix NULL pointer dereference by initializing user_ns efi/libstub: gop: Fix EDID support in mixed-mode
2 parents 3f0e9c8 + cfe54f4 commit b63f4a4

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

drivers/firmware/efi/efi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ struct mm_struct efi_mm = {
7373
MMAP_LOCK_INITIALIZER(efi_mm)
7474
.page_table_lock = __SPIN_LOCK_UNLOCKED(efi_mm.page_table_lock),
7575
.mmlist = LIST_HEAD_INIT(efi_mm.mmlist),
76+
.user_ns = &init_user_ns,
7677
.cpu_bitmap = { [BITS_TO_LONGS(NR_CPUS)] = 0},
7778
#ifdef CONFIG_SCHED_MM_CID
7879
.mm_cid.lock = __RAW_SPIN_LOCK_UNLOCKED(efi_mm.mm_cid.lock),

drivers/firmware/efi/libstub/gop.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -513,15 +513,15 @@ efi_status_t efi_setup_graphics(struct screen_info *si, struct edid_info *edid)
513513
status = efi_bs_call(handle_protocol, handle, &EFI_EDID_ACTIVE_PROTOCOL_GUID,
514514
(void **)&active_edid);
515515
if (status == EFI_SUCCESS) {
516-
gop_size_of_edid = active_edid->size_of_edid;
517-
gop_edid = active_edid->edid;
516+
gop_size_of_edid = efi_table_attr(active_edid, size_of_edid);
517+
gop_edid = efi_table_attr(active_edid, edid);
518518
} else {
519519
status = efi_bs_call(handle_protocol, handle,
520520
&EFI_EDID_DISCOVERED_PROTOCOL_GUID,
521521
(void **)&discovered_edid);
522522
if (status == EFI_SUCCESS) {
523-
gop_size_of_edid = discovered_edid->size_of_edid;
524-
gop_edid = discovered_edid->edid;
523+
gop_size_of_edid = efi_table_attr(discovered_edid, size_of_edid);
524+
gop_edid = efi_table_attr(discovered_edid, edid);
525525
}
526526
}
527527

kernel/kthread.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1599,6 +1599,7 @@ void kthread_use_mm(struct mm_struct *mm)
15991599

16001600
WARN_ON_ONCE(!(tsk->flags & PF_KTHREAD));
16011601
WARN_ON_ONCE(tsk->mm);
1602+
WARN_ON_ONCE(!mm->user_ns);
16021603

16031604
/*
16041605
* It is possible for mm to be the same as tsk->active_mm, but

0 commit comments

Comments
 (0)