1
0
Fork 0
alistair23-linux/arch
Dmitry V. Levin b7dc5a071d parisc: Fix ptrace syscall number modification
Commit 910cd32e55 ("parisc: Fix and enable seccomp filter support")
introduced a regression in ptrace-based syscall tampering: when tracer
changes syscall number to -1, the kernel fails to initialize %r28 with
-ENOSYS and subsequently fails to return the error code of the failed
syscall to userspace.

This erroneous behaviour could be observed with a simple strace syscall
fault injection command which is expected to print something like this:

$ strace -a0 -ewrite -einject=write:error=enospc echo hello
write(1, "hello\n", 6) = -1 ENOSPC (No space left on device) (INJECTED)
write(2, "echo: ", 6) = -1 ENOSPC (No space left on device) (INJECTED)
write(2, "write error", 11) = -1 ENOSPC (No space left on device) (INJECTED)
write(2, "\n", 1) = -1 ENOSPC (No space left on device) (INJECTED)
+++ exited with 1 +++

After commit 910cd32e55 it loops printing
something like this instead:

write(1, "hello\n", 6../strace: Failed to tamper with process 12345: unexpectedly got no error (return value 0, error 0)
) = 0 (INJECTED)

This bug was found by strace test suite.

Fixes: 910cd32e55 ("parisc: Fix and enable seccomp filter support")
Cc: stable@vger.kernel.org # v4.5+
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Tested-by: Helge Deller <deller@gmx.de>
Signed-off-by: Helge Deller <deller@gmx.de>
2019-02-21 20:10:46 +01:00
..
alpha alpha: fix page fault handling for r16-r18 targets 2019-02-10 20:42:23 -08:00
arc ARCv2: lib: memeset: fix doing prefetchw outside of buffer 2019-01-17 16:24:39 -08:00
arm A few ARM fixes: 2019-02-18 09:59:28 -08:00
arm64 Merge branch 'efi-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-02-17 09:22:01 -08:00
c6x arch: unexport asm/shmparam.h for all architectures 2019-02-01 15:46:22 -08:00
csky csky: Fixup dead loop in show_stack 2019-02-13 09:48:14 +08:00
h8300 arch: unexport asm/shmparam.h for all architectures 2019-02-01 15:46:22 -08:00
hexagon arch: unexport asm/shmparam.h for all architectures 2019-02-01 15:46:22 -08:00
ia64 ia64: remove redundant 'export AWK' 2019-01-16 23:31:18 +09:00
m68k for-linus-20190209 2019-02-09 10:26:09 -08:00
microblaze arch: unexport asm/shmparam.h for all architectures 2019-02-01 15:46:22 -08:00
mips Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf 2019-02-16 22:34:07 -08:00
nds32 nds32: remove unneeded code in arch/nds32/Makefile 2019-01-17 23:42:37 +09:00
nios2 arch: remove redundant UAPI generic-y defines 2019-01-06 10:22:15 +09:00
openrisc arch: unexport asm/shmparam.h for all architectures 2019-02-01 15:46:22 -08:00
parisc parisc: Fix ptrace syscall number modification 2019-02-21 20:10:46 +01:00
powerpc powerpc fixes for 5.0 #5 2019-02-17 08:36:21 -08:00
riscv Revert "RISC-V: Make BSS section as the last section in vmlinux.lds.S" 2019-02-11 15:24:45 -08:00
s390 Revert "s390/pci: remove bit_lock usage in interrupt handler" 2019-02-07 11:56:29 +01:00
sh Kbuild late updates for v4.21 2019-01-06 16:33:10 -08:00
sparc arch: remove redundant UAPI generic-y defines 2019-01-06 10:22:15 +09:00
um Merge branch 'akpm' (patches from Andrew) 2019-01-05 09:16:18 -08:00
unicore32 arch: unexport asm/shmparam.h for all architectures 2019-02-01 15:46:22 -08:00
x86 Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-02-17 08:44:38 -08:00
xtensa xtensa: SMP: limit number of possible CPUs by NR_CPUS 2019-01-27 10:04:30 -08:00
.gitignore
Kconfig jump_label: move 'asm goto' support test to Kconfig 2019-01-06 09:46:51 +09:00