android_kernel_motorola_sm6375/arch
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Lee Jones 94199d4727 x86/mm: Avoid using set_pgd() outside of real PGD pages
commit d082d48737c75d2b3cc1f972b8c8674c25131534 upstream.

KPTI keeps around two PGDs: one for userspace and another for the
kernel. Among other things, set_pgd() contains infrastructure to
ensure that updates to the kernel PGD are reflected in the user PGD
as well.

One side-effect of this is that set_pgd() expects to be passed whole
pages.  Unfortunately, init_trampoline_kaslr() passes in a single entry:
'trampoline_pgd_entry'.

When KPTI is on, set_pgd() will update 'trampoline_pgd_entry' (an
8-Byte globally stored [.bss] variable) and will then proceed to
replicate that value into the non-existent neighboring user page
(located +4k away), leading to the corruption of other global [.bss]
stored variables.

Fix it by directly assigning 'trampoline_pgd_entry' and avoiding
set_pgd().

[ dhansen: tweak subject and changelog ]

Fixes: 0925dda596 ("x86/mm/KASLR: Use only one PUD entry for real mode trampoline")
Suggested-by: Dave Hansen <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
Signed-off-by: Dave Hansen <[email protected]>
Cc: <[email protected]>
Link: https://lore.kernel.org/all/[email protected]/g
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2023-06-28 10:18:38 +02:00
..
alpha alpha: fix R_ALPHA_LITERAL reloc for large modules 2023-03-17 08:32:52 +01:00
arc dma-mapping: drop the dev argument to arch_sync_dma_for_* 2023-04-05 11:16:43 +02:00
arm ARM: dts: vexpress: add missing cache properties 2023-06-21 15:44:09 +02:00
arm64 arm64/mm: mark private VM_FAULT_X defines as vm_fault_t 2023-06-09 10:28:58 +02:00
c6x dma-mapping: drop the dev argument to arch_sync_dma_for_* 2023-04-05 11:16:43 +02:00
csky dma-mapping: drop the dev argument to arch_sync_dma_for_* 2023-04-05 11:16:43 +02:00
h8300 h8300: Fix build errors from do_exit() to make_task_dead() transition 2023-02-06 07:52:49 +01:00
hexagon dma-mapping: drop the dev argument to arch_sync_dma_for_* 2023-04-05 11:16:43 +02:00
ia64 treewide: Remove uninitialized_var() usage 2023-06-09 10:29:01 +02:00
m68k m68k: Move signal frame following exception on 68020/030 2023-05-30 12:44:09 +01:00
microblaze dma-mapping: drop the dev argument to arch_sync_dma_for_* 2023-04-05 11:16:43 +02:00
mips Remove DECnet support from kernel 2023-06-21 15:44:10 +02:00
nds32 dma-mapping: drop the dev argument to arch_sync_dma_for_* 2023-04-05 11:16:43 +02:00
nios2 nios2: dts: Fix tse_mac "max-frame-size" property 2023-06-21 15:44:10 +02:00
openrisc openrisc: Properly store r31 to pt_regs on unhandled exceptions 2023-05-17 11:35:53 +02:00
parisc parisc: Improve cache flushing for PCXL in arch_sync_dma_for_cpu() 2023-06-21 15:44:09 +02:00
powerpc Remove DECnet support from kernel 2023-06-21 15:44:10 +02:00
riscv riscv: Bump COMMAND_LINE_SIZE value to 1024 2023-04-05 11:16:39 +02:00
s390 treewide: Remove uninitialized_var() usage 2023-06-09 10:29:01 +02:00
sh sh: nmi_debug: fix return value of __setup handler 2023-05-17 11:36:01 +02:00
sparc dma-mapping: drop the dev argument to arch_sync_dma_for_* 2023-04-05 11:16:43 +02:00
um UML: define RUNTIME_DISCARD_EXIT 2023-03-17 08:32:54 +01:00
unicore32
x86 x86/mm: Avoid using set_pgd() outside of real PGD pages 2023-06-28 10:18:38 +02:00
xtensa dma-mapping: drop the dev argument to arch_sync_dma_for_* 2023-04-05 11:16:43 +02:00
.gitignore
Kconfig