Skip to content

Commit 661e723

Browse files
committed
Merge tag 'x86_urgent_for_v6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Borislav Petkov: - Do not use set_pgd() when updating the KASLR trampoline pgd entry because that updates the user PGD too on KPTI builds, resulting in memory corruption - Prevent a panic in the IO-APIC setup code due to conflicting command line parameters * tag 'x86_urgent_for_v6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/apic: Fix kernel panic when booting with intremap=off and x2apic_phys x86/mm: Avoid using set_pgd() outside of real PGD pages
2 parents a92b7d2 + 85d38d5 commit 661e723

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

arch/x86/kernel/apic/x2apic_phys.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@ static void init_x2apic_ldr(void)
9797

9898
static int x2apic_phys_probe(void)
9999
{
100-
if (x2apic_mode && (x2apic_phys || x2apic_fadt_phys()))
100+
if (!x2apic_mode)
101+
return 0;
102+
103+
if (x2apic_phys || x2apic_fadt_phys())
101104
return 1;
102105

103106
return apic == &apic_x2apic_phys;

arch/x86/mm/kaslr.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,10 @@ void __meminit init_trampoline_kaslr(void)
172172
set_p4d(p4d_tramp,
173173
__p4d(_KERNPG_TABLE | __pa(pud_page_tramp)));
174174

175-
set_pgd(&trampoline_pgd_entry,
176-
__pgd(_KERNPG_TABLE | __pa(p4d_page_tramp)));
175+
trampoline_pgd_entry =
176+
__pgd(_KERNPG_TABLE | __pa(p4d_page_tramp));
177177
} else {
178-
set_pgd(&trampoline_pgd_entry,
179-
__pgd(_KERNPG_TABLE | __pa(pud_page_tramp)));
178+
trampoline_pgd_entry =
179+
__pgd(_KERNPG_TABLE | __pa(pud_page_tramp));
180180
}
181181
}

0 commit comments

Comments
 (0)