]> granicus.if.org Git - strace/commit
hppa: workaround kernel bug in syscall number tampering
authorDmitry V. Levin <ldv@altlinux.org>
Sun, 17 Feb 2019 00:10:26 +0000 (00:10 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 17 Feb 2019 00:10:26 +0000 (00:10 +0000)
commitce494f63d2a4de22a08b5ed807e6195ece8b9632
treecb5f7175b7f80b332a592e06721a3aa92134c89c
parent146bfcb8ac654263c511fd213de2a19f4a6e1a9f
hppa: workaround kernel bug in syscall number tampering

Linux kernel commit v4.6-rc2~20^2 introduced a regression:
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.
Workaround this by initializing %r28 ourselves.

* linux/arch_defs_.h (ARCH_NEEDS_SET_ERROR_FOR_SCNO_TAMPERING): Define
to 0.
* linux/hppa/arch_defs_.h (ARCH_NEEDS_SET_ERROR_FOR_SCNO_TAMPERING):
Define to 1.
* syscall.c (tamper_with_syscall_entering)
[ARCH_NEEDS_SET_ERROR_FOR_SCNO_TAMPERING]: When changing syscall number
to -1, set the return value as well.
linux/arch_defs_.h
linux/hppa/arch_defs_.h
syscall.c