An explicit get_regs invocation was added to arch_set_error and
arch_set_success on sparc/sparc64 by commit v5.2~27 in attempt to fix
syscall tampering on these architectures when PTRACE_GET_SYSCALL_INFO
is in use.
That change, however, did not fix the bug because set_error and
set_success already invoke get_regs on all architectures where
ptrace_setregset_or_setregs is defined, this includes sparc and sparc64.
* linux/sparc/set_error.c (sparc_set_o0_psr): Do not invoke get_regs.
* linux/sparc64/set_error.c (sparc64_set_o0_tstate): Likewise.
* NEWS (5.2): Remove the statement about syscall tampering fix
on sparc and sparc64 when PTRACE_GET_SYSCALL_INFO is in use.
* Updated lists of ioctl commands from Linux 5.2.
* Bug fixes
- * Fixed syscall tampering on powerpc, powerpc64, sparc, and sparc64 when
+ * Fixed syscall tampering on powerpc and powerpc64 when
PTRACE_GET_SYSCALL_INFO is in use.
* Fixed build with cutting-edge toolchain.
sparc_set_o0_psr(struct tcb *tcp, const unsigned long o0,
const unsigned long psr_set, const unsigned long psr_clear)
{
- if (ptrace_syscall_info_is_valid() && get_regs(tcp) < 0)
- return -1;
sparc_regs.u_regs[U_REG_O0] = o0;
sparc_regs.psr |= psr_set;
sparc_regs.psr &= ~psr_clear;
const unsigned long tstate_set,
const unsigned long tstate_clear)
{
- if (ptrace_syscall_info_is_valid() && get_regs(tcp) < 0)
- return -1;
sparc_regs.u_regs[U_REG_O0] = o0;
sparc_regs.tstate |= tstate_set;
sparc_regs.tstate &= ~tstate_clear;