linux/arch/arc/kernel
Vineet Gupta 01b636cbc4 ARC: entry: fix potential EFA clobber when TIF_SYSCALL_TRACE
commit 00fdec98d9 upstream.

Trap handler for syscall tracing reads EFA (Exception Fault Address),
in case strace wants PC of trap instruction (EFA is not part of pt_regs
as of current code).

However this EFA read is racy as it happens after dropping to pure
kernel mode (re-enabling interrupts). A taken interrupt could
context-switch, trigger a different task's trap, clobbering EFA for this
execution context.

Fix this by reading EFA early, before re-enabling interrupts. A slight
side benefit is de-duplication of FAKE_RET_FROM_EXCPN in trap handler.
The trap handler is common to both ARCompact and ARCv2 builds too.

This just came out of code rework/review and no real problem was reported
but is clearly a potential problem specially for strace.

Cc: <stable@vger.kernel.org>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-16 08:17:27 +02:00
..
.gitignore
arc_hostlink.c
arcksyms.c
asm-offsets.c
ctx_sw_asm.S
ctx_sw.c
devtree.c
disasm.c
entry-arcv2.S ARCv2: support manual regfile save on interrupts 2019-03-23 20:09:51 +01:00
entry-compact.S
entry.S ARC: entry: fix potential EFA clobber when TIF_SYSCALL_TRACE 2020-07-16 08:17:27 +02:00
fpu.c
head.S ARC: enable uboot support unconditionally 2019-08-06 19:06:57 +02:00
intc-arcv2.c ARCv2: support manual regfile save on interrupts 2019-03-23 20:09:51 +01:00
intc-compact.c
irq.c
kgdb.c
kprobes.c bpf/error-inject/kprobes: Clear current_kprobe and enable preempt in kprobe 2018-06-21 12:33:19 +02:00
Makefile
mcip.c
module.c
perf_event.c ARC: perf: Accommodate big-endian CPU 2019-12-01 09:17:37 +01:00
process.c ARC: clone syscall to setp r25 as thread pointer 2018-10-05 14:33:29 -07:00
ptrace.c
reset.c
setup.c ARC: Fix ICCM & DCCM runtime size checks 2020-06-07 13:17:55 +02:00
signal.c
smp.c
stacktrace.c
sys.c
traps.c
troubleshoot.c ARC: show_regs: lockdep: re-enable preemption 2019-09-16 08:22:02 +02:00
unaligned.c
unwind.c ARC: hide unused function unw_hdr_alloc 2019-07-21 09:03:14 +02:00
vmlinux.lds.S