]> git.baikalelectronics.ru Git - kernel.git/commit
s390/ptrace: fix setting syscall number
authorSven Schnelle <svens@linux.ibm.com>
Mon, 9 Mar 2020 15:44:50 +0000 (16:44 +0100)
committerVasily Gorbik <gor@linux.ibm.com>
Tue, 16 Jun 2020 11:44:04 +0000 (13:44 +0200)
commit576746763e7f4e4a8a50081845de6da016ee44e7
treeb9f89c12afdd3f5268c507b9424fadb922c9f9c5
parent9486b2e3dc2ae744e7f2c712011e3b5893b346ca
s390/ptrace: fix setting syscall number

When strace wants to update the syscall number, it sets GPR2
to the desired number and updates the GPR via PTRACE_SETREGSET.
It doesn't update regs->int_code which would cause the old syscall
executed on syscall restart. As we cannot change the ptrace ABI and
don't have a field for the interruption code, check whether the tracee
is in a syscall and the last instruction was svc. In that case assume
that the tracer wants to update the syscall number and copy the GPR2
value to regs->int_code.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/kernel/ptrace.c