kernel_samsung_a53x/arch/x86/mm
Peter Zijlstra 169950cfb4 x86/mm: Fix pti_clone_pgtable() alignment assumption
[ Upstream commit 41e71dbb0e0a0fe214545fe64af031303a08524c ]

Guenter reported dodgy crashes on an i386-nosmp build using GCC-11
that had the form of endless traps until entry stack exhaust and then
#DF from the stack guard.

It turned out that pti_clone_pgtable() had alignment assumptions on
the start address, notably it hard assumes start is PMD aligned. This
is true on x86_64, but very much not true on i386.

These assumptions can cause the end condition to malfunction, leading
to a 'short' clone. Guess what happens when the user mapping has a
short copy of the entry text?

Use the correct increment form for addr to avoid alignment
assumptions.

Fixes: 16a3fe634f6a ("x86/mm/pti: Clone kernel-image on PTE level for 32 bit")
Reported-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20240731163105.GG33588@noisy.programming.kicks-ass.net
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-23 23:20:21 +01:00
..
pat x86/mm/pat: fix VM_PAT handling in COW mappings 2024-11-19 09:23:15 +01:00
amdtopology.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cpu_entry_area.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
debug_pagetables.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dump_pagetables.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
extable.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fault.c x86/mm: Remove broken vsyscall emulation code from the page fault code 2024-11-19 12:27:13 +01:00
highmem_32.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hugetlbpage.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ident_map.c Revert "x86/mm/ident_map: Use gbpages only where full GB page should be mapped." 2024-11-19 09:22:46 +01:00
init.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
init_32.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
init_64.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
iomap_32.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ioremap.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kasan_init_64.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kaslr.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kmmio.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
maccess.c x86/mm: Disallow vsyscall page read for copy_from_kernel_nofault() 2024-11-19 08:44:36 +01:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mem_encrypt.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mem_encrypt_boot.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mem_encrypt_identity.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mm_internal.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mmap.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mmio-mod.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
numa.c x86/mm: Drop the 4 MB restriction on minimal NUMA node memory size 2024-11-18 11:43:12 +01:00
numa_32.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
numa_64.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
numa_emulation.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
numa_internal.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pf_in.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pf_in.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pgtable.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pgtable_32.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
physaddr.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
physaddr.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pkeys.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pti.c x86/mm: Fix pti_clone_pgtable() alignment assumption 2024-11-23 23:20:21 +01:00
setup_nx.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
srat.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
testmmiotrace.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tlb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00