linux/arch/arm64
Timothy E Baldwin df84fe9470 arm64: ptrace: Fix seccomp of traced syscall -1 (NO_SYSCALL)
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>
2021-02-25 10:27:43 +00:00
..
boot ARM: SoC fixes for v5.11 2021-01-08 14:13:54 -08:00
configs ARM: device tree updates for 5.11 2020-12-16 16:27:35 -08:00
crypto crypto: sha - split sha.h into sha1.h and sha2.h 2020-11-20 14:45:33 +11:00
include arm64 module: set plt* section addresses to 0x0 2021-02-19 17:59:59 +00:00
kernel arm64: ptrace: Fix seccomp of traced syscall -1 (NO_SYSCALL) 2021-02-25 10:27:43 +00:00
kvm KVM: arm64: make the hyp vector table entries local 2021-02-24 11:20:43 +00:00
lib arm64: mte: add in-kernel MTE helpers 2020-12-22 12:55:07 -08:00
mm arm64/mm: Fixed some coding style issues 2021-02-23 10:40:54 +00:00
net arm64: bpf: Fix branch offset in JIT 2020-09-17 12:05:36 +01:00
xen
Kbuild
Kconfig Merge branch 'for-next/misc' into for-next/core 2021-02-12 15:07:34 +00:00
Kconfig.debug
Kconfig.platforms ARM: device tree updates for 5.11 2020-12-16 16:27:35 -08:00
Makefile arm64: do not descend to vdso directories twice 2021-01-20 12:18:46 +00:00