linux_dsm_epyc7002/arch
Vineet Gupta 00fdec98d9 ARC: entry: fix potential EFA clobber when TIF_SYSCALL_TRACE
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>
2020-06-16 12:56:37 -07:00
..
alpha Kbuild updates for v5.8 (2nd) 2020-06-13 13:29:16 -07:00
arc
arm Kbuild updates for v5.8 (2nd) 2020-06-13 13:29:16 -07:00
arm64
c6x
csky
h8300
hexagon
ia64
m68k
microblaze mmap locking API: convert mmap_sem comments 2020-06-09 09:39:14 -07:00
mips
nds32
nios2 nios2 update for v5.8-rc1 2020-06-12 11:55:11 -07:00
openrisc OpenRISC updates for 5.8 2020-06-13 10:54:09 -07:00
parisc treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
powerpc
riscv
s390
sh
sparc treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
um
unicore32 This time around we have 4 lines of diff in the core framework, removing a 2020-06-10 11:42:19 -07:00
x86
xtensa
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
Kconfig