linux-stable/arch/arm64
Timothy E Baldwin 428c4a4d0d arm64: ptrace: Fix seccomp of traced syscall -1 (NO_SYSCALL)
commit df84fe9470 upstream.

Since commit f086f67485 ("arm64: ptrace: add support for syscall
emulation"), if system call number -1 is called and the process is being
traced with PTRACE_SYSCALL, for example by strace, the seccomp check is
skipped and -ENOSYS is returned unconditionally (unless altered by the
tracer) rather than carrying out action specified in the seccomp filter.

The consequence of this is that it is not possible to reliably strace
a seccomp based implementation of a foreign system call interface in
which r7/x8 is permitted to be -1 on entry to a system call.

Also trace_sys_enter and audit_syscall_entry are skipped if a system
call is skipped.

Fix by removing the in_syscall(regs) check restoring the previous
behaviour which is like AArch32, x86 (which uses generic code) and
everything else.

Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Catalin Marinas<catalin.marinas@arm.com>
Cc: <stable@vger.kernel.org>
Fixes: f086f67485 ("arm64: ptrace: add support for syscall emulation")
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Tested-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Timothy E Baldwin <T.E.Baldwin99@members.leeds.ac.uk>
Link: https://lore.kernel.org/r/90edd33b-6353-1228-791f-0336d94d5f8c@majoroak.me.uk
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-04 11:38:32 +01:00
..
boot arm64: dts: qcom: qrb5165-rb5: fix pm8009 regulators 2021-03-04 11:37:53 +01:00
configs arm64: defconfig: Build in CONFIG_GPIO_MXC by default 2020-10-26 15:48:58 +08:00
crypto crypto: arm64/sha - add missing module aliases 2021-03-04 11:38:31 +01:00
include arm64: Do not pass tagged addresses to __is_lm_address() 2021-02-07 15:37:13 +01:00
kernel arm64: ptrace: Fix seccomp of traced syscall -1 (NO_SYSCALL) 2021-03-04 11:38:32 +01:00
kvm KVM: arm64: Filter out v8.1+ events on v8.0 HW 2021-02-03 23:28:41 +01:00
lib arm64: Change .weak to SYM_FUNC_START_WEAK_PI for arch/arm64/lib/mem*.S 2020-10-30 08:32:31 +00:00
mm arm64: Do not pass tagged addresses to __is_lm_address() 2021-02-07 15:37:13 +01:00
net arm64: bpf: Fix branch offset in JIT 2020-09-17 12:05:36 +01:00
xen
Kbuild
Kconfig kbuild: Hoist '--orphan-handling' into Kconfig 2020-12-01 22:45:36 +09:00
Kconfig.debug arm64: remove TEXT_OFFSET randomization 2020-06-15 13:10:59 +01:00
Kconfig.platforms arm64: berlin: Select DW_APB_TIMER_OF 2020-10-26 10:45:03 +01:00
Makefile arm64: link with -z norelro for LLD or aarch64-elf 2021-01-12 20:18:24 +01:00