linux_dsm_epyc7002/arch/parisc/kernel
Sven Schnelle 740f05f30a parisc: fix race condition in patching code
Assume the following ftrace code sequence that was patched in earlier by
ftrace_make_call():

PAGE A:
ffc:	addr of ftrace_caller()
PAGE B:
000:	0x6fc10080 /* stw,ma r1,40(sp) */
004:	0x48213fd1 /* ldw -18(r1),r1 */
008:	0xe820c002 /* bv,n r0(r1) */
00c:	0xe83f1fdf /* b,l,n .-c,r1 */

When a Code sequences that is to be patched spans a page break, we might
have already cleared the part on the PAGE A. If an interrupt is coming in
during the remap of the fixed mapping to PAGE B, it might execute the
patched function with only parts of the FTRACE code cleared. To prevent
this, clear the jump to our mini trampoline first, and clear the remaining
parts after this. This might also happen when patch_text() patches a
function that it calls during remap.

Signed-off-by: Sven Schnelle <svens@stackframe.org>
Cc: <stable@vger.kernel.org> # 5.2+
Signed-off-by: Helge Deller <deller@gmx.de>
2019-07-31 16:20:57 +02:00
..
syscalls parisc: Wire up clone3 syscall 2019-07-17 23:11:28 +02:00
.gitignore
alternative.c
asm-offsets.c
audit.c
cache.c
compat_audit.c
drivers.c
entry.S parisc: Wire up clone3 syscall 2019-07-17 23:11:28 +02:00
firmware.c
ftrace.c parisc: fix race condition in patching code 2019-07-31 16:20:57 +02:00
hardware.c
head.S
hpmc.S
inventory.c
irq.c
jump_label.c
kgdb.c
kprobes.c parisc: Avoid kernel panic triggered by invalid kprobe 2019-07-17 23:11:28 +02:00
Makefile
module.c
module.lds
pa7300lc.c
pacache.S parisc: Flush ITLB in flush_tlb_all_local() only on split TLB machines 2019-07-21 11:03:02 +02:00
parisc_ksyms.c
patch.c
pci-dma.c
pci.c
pdc_chassis.c
pdc_cons.c
pdt.c
perf_asm.S
perf_images.h
perf.c
process.c
processor.c
ptrace.c parisc: Ensure userspace privilege for ptraced processes in regset functions 2019-07-17 23:11:27 +02:00
real2.S
setup.c
signal32.c
signal32.h
signal.c
smp.c
stacktrace.c
sys_parisc32.c
sys_parisc.c
syscall.S
time.c
topology.c
traps.c
unaligned.c
unwind.c
vmlinux.lds.S