linux-stable/arch
Juergen Gross 0bf9fd89ba x86/alternative: Don't call text_poke() in lazy TLB mode
commit abee7c494d upstream.

When running in lazy TLB mode the currently active page tables might
be the ones of a previous process, e.g. when running a kernel thread.

This can be problematic in case kernel code is being modified via
text_poke() in a kernel thread, and on another processor exit_mmap()
is active for the process which was running on the first cpu before
the kernel thread.

As text_poke() is using a temporary address space and the former
address space (obtained via cpu_tlbstate.loaded_mm) is restored
afterwards, there is a race possible in case the cpu on which
exit_mmap() is running wants to make sure there are no stale
references to that address space on any cpu active (this e.g. is
required when running as a Xen PV guest, where this problem has been
observed and analyzed).

In order to avoid that, drop off TLB lazy mode before switching to the
temporary address space.

Fixes: cefa929c03 ("x86/mm: Introduce temporary mm structs")
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20201009144225.12019-1-jgross@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-04-13 12:51:40 +02:00
..
alpha y2038: rusage: use __kernel_old_timeval 2024-03-15 10:48:18 -04:00
arc ARC: fix spare error 2024-01-25 14:34:20 -08:00
arm arm: dts: marvell: Fix maxium->maxim typo in brownstone dts 2024-04-13 12:51:22 +02:00
arm64 arm64: dts: rockchip: fix rk3399 hdmi ports node 2024-04-13 12:51:37 +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 arch, mm: remove stale mentions of DISCONIGMEM 2024-02-23 08:25:13 +01:00
m68k m68k: Fix invalid .section syntax 2023-09-23 10:59:38 +02:00
microblaze dma-mapping: drop the dev argument to arch_sync_dma_for_* 2023-04-05 11:16:43 +02:00
mips MIPS: Clear Cause.BD in instruction_pointer_set 2024-03-26 18:22:12 -04:00
nds32 arch, mm: remove stale mentions of DISCONIGMEM 2024-02-23 08:25:13 +01: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: Strip upper 32 bit of sum in csum_ipv6_magic for 64-bit builds 2024-04-13 12:51:24 +02:00
powerpc powerpc: xor_vmx: Add '-mhard-float' to CFLAGS 2024-04-13 12:51:31 +02:00
riscv riscv: Bump COMMAND_LINE_SIZE value to 1024 2023-04-05 11:16:39 +02:00
s390 s390/entry: align system call table on 8 bytes 2024-04-13 12:51:37 +02:00
sh sh: bios: Revive earlyprintk support 2023-11-20 10:30:13 +01:00
sparc sparc: vDSO: fix return value of __setup handler 2024-04-13 12:51:22 +02:00
um um: allow not setting extra rpaths in the linux binary 2024-03-15 10:48:16 -04:00
unicore32
x86 x86/alternative: Don't call text_poke() in lazy TLB mode 2024-04-13 12:51:40 +02:00
xtensa arch, mm: remove stale mentions of DISCONIGMEM 2024-02-23 08:25:13 +01:00
.gitignore
Kconfig init: Provide arch_cpu_finalize_init() 2023-08-08 19:56:33 +02:00