android_kernel_sony_sdm845/arch/s390
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Dmitry V. Levin 11c46697a8 s390: fix syscall_get_error for compat processes
commit b3583fca5fb654af2cfc1c08259abb9728272538 upstream.

If both the tracer and the tracee are compat processes, and gprs[2]
is assigned a value by __poke_user_compat, then the higher 32 bits
of gprs[2] are cleared, IS_ERR_VALUE() always returns false, and
syscall_get_error() always returns 0.

Fix the implementation by sign-extending the value for compat processes
the same way as x86 implementation does.

The bug was exposed to user space by commit 201766a20e30f ("ptrace: add
PTRACE_GET_SYSCALL_INFO request") and detected by strace test suite.

This change fixes strace syscall tampering on s390.

Link: https://lkml.kernel.org/r/20200602180051.GA2427@altlinux.org
Fixes: 753c4dd6a2 ("[S390] ptrace changes")
Cc: Elvira Khabirova <lineprinter@altlinux.org>
Cc: stable@vger.kernel.org # v2.6.28+
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-30 15:38:32 -04:00
..
appldata sched/cputime: Convert kcpustat to nsecs 2018-10-20 09:51:32 +02:00
boot s390/decompressor: fix initrd corruption caused by bss clear 2017-04-12 12:41:14 +02:00
configs Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2016-10-04 14:05:52 -07:00
crypto s390/crypto: xts-aes-s390 fix extra run-time crypto self tests finding 2019-10-05 12:30:27 +02:00
hypfs hypfs: Fix error number left in struct pointer member 2019-10-07 18:53:18 +02:00
include s390: fix syscall_get_error for compat processes 2020-06-30 15:38:32 -04:00
kernel s390/ftrace: save traced function caller 2020-06-11 09:22:19 +02:00
kvm KVM: s390: vsie: Fix delivery of addressing exceptions 2020-04-24 07:58:55 +02:00
lib s390/lib: use expoline for all bcr instructions 2018-09-15 09:43:06 +02:00
mm KVM: s390: vsie: Fix possible race when shadowing region 3 tables 2020-04-24 07:59:13 +02:00
net s390/bpf: use 32-bit index for tail calls 2019-09-21 07:14:12 +02:00
numa s390/mm: Fix ERROR: "__node_distance" undefined! 2018-11-27 16:09:39 +01:00
oprofile s390/dumpstack: restore reliable indicator for call traces 2016-10-17 14:44:30 +02:00
pci s390/pci: fix out of bounds access during irq setup 2018-09-05 09:20:10 +02:00
tools s390/facilities: do not generate DWORDS define anymore 2016-07-31 05:27:59 -04:00
defconfig mm/usercopy: get rid of CONFIG_DEBUG_STRICT_USER_COPY_CHECKS 2016-08-30 10:10:21 -07:00
Kbuild s390/numa: add core infrastructure 2015-08-03 18:40:25 +02:00
Kconfig s390: add sysfs attributes for spectre 2018-04-29 11:32:00 +02:00
Kconfig.debug arch: consolidate CONFIG_STRICT_DEVM in lib/Kconfig.debug 2016-01-09 06:30:49 -08:00
Makefile s390: add automatic detection of the spectre defense 2018-04-29 11:31:59 +02:00