kernel_optimize_test/arch/sh
Rich Felker b0cfc315ff sh: fix syscall tracing
Addition of SECCOMP_FILTER exposed a longstanding bug in
do_syscall_trace_enter, whereby r0 (the 5th argument register) was
mistakenly used where r3 (syscall_nr) was intended. By overwriting r0
rather than r3 with -1 when attempting to block a syscall, the
existing code would instead have caused the syscall to execute with an
argument clobbered.

Commit 0bb605c2c7 then introduced skipping of the syscall when
do_syscall_trace_enter returns -1, so that the return value set by
seccomp filters would not be clobbered by -ENOSYS. This eliminated the
clobbering of the 5th argument register, but instead caused syscalls
made with a 5th argument of -1 to be misinterpreted as a request by
do_syscall_trace_enter to suppress the syscall.

Fixes: 0bb605c2c7 ("sh: Add SECCOMP_FILTER")
Fixes: ab99c733ae ("sh: Make syscall tracer use tracehook notifiers, add TIF_NOTIFY_RESUME.")
Tested-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Signed-off-by: Rich Felker <dalias@libc.org>
2020-09-13 21:22:55 -04:00
..
boards sh: landisk: Add missing initialization of sh_io_port_base 2020-08-14 22:43:17 -04:00
boot kbuild: introduce ccflags-remove-y and asflags-remove-y 2020-08-10 01:32:59 +09:00
cchips treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
configs Cleanup, SECCOMP_FILTER support, message printing fixes, and other 2020-08-15 18:50:32 -07:00
drivers treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
include sh: remove spurious circular inclusion from asm/smp.h 2020-09-13 21:11:40 -04:00
kernel sh: fix syscall tracing 2020-09-13 21:22:55 -04:00
lib sh: remove -Werror from Makefiles 2020-08-14 22:05:13 -04:00
math-emu
mm Cleanup, SECCOMP_FILTER support, message printing fixes, and other 2020-08-15 18:50:32 -07:00
oprofile sh: stacktrace: Remove stacktrace_ops.stack() 2020-08-14 22:05:11 -04:00
tools sh: Remove SH5-based Cayman platform 2020-08-14 22:05:06 -04:00
Kconfig sh: Add SECCOMP_FILTER 2020-08-14 22:05:19 -04:00
Kconfig.cpu docs: sh: convert register-banks.txt to ReST 2020-06-19 14:10:13 -06:00
Kconfig.debug
Makefile sh: Remove SH5-based Cayman platform 2020-08-14 22:05:06 -04:00