summaryrefslogtreecommitdiff
path: root/arch/x86/entry
diff options
context:
space:
mode:
authorJuergen Gross <jgross@suse.com>2020-10-09 17:42:25 +0300
committerPeter Zijlstra <peterz@infradead.org>2020-10-22 13:37:23 +0300
commitabee7c494d8c41bb388839bccc47e06247f0d7de (patch)
tree0b904d33a73260c4ea96b1cd20322416505de3e0 /arch/x86/entry
parentc3b484c439b0bab7a698495f33ef16286a1000c4 (diff)
downloadlinux-abee7c494d8c41bb388839bccc47e06247f0d7de.tar.xz
x86/alternative: Don't call text_poke() in lazy TLB mode
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: cefa929c034eb5d ("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
Diffstat (limited to 'arch/x86/entry')
0 files changed, 0 insertions, 0 deletions