]> git.baikalelectronics.ru Git - kernel.git/commit
mips: fix syscall_get_nr
authorElvira Khabirova <lineprinter0@gmail.com>
Sat, 18 Feb 2023 22:43:59 +0000 (23:43 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 15:44:04 +0000 (16:44 +0100)
commit8a5d7240208c00ea6ca4e88061a091e32ef38715
tree86e3a7efe10eac36450dab5e59e0b56ab89d3d86
parent153c5249ce81f0e6d2f5d5fd12c094ef91df92fa
mips: fix syscall_get_nr

commit 85cc91e2ba4262a602ec65e2b76c4391a9e60d3d upstream.

The implementation of syscall_get_nr on mips used to ignore the task
argument and return the syscall number of the calling thread instead of
the target thread.

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

Link: https://github.com/strace/strace/issues/235
Fixes: ec8f76e2e5f1 ("MIPS: Fix syscall_get_nr for the syscall exit tracing.")
Cc: <stable@vger.kernel.org> # v3.19+
Co-developed-by: Dmitry V. Levin <ldv@strace.io>
Signed-off-by: Dmitry V. Levin <ldv@strace.io>
Signed-off-by: Elvira Khabirova <lineprinter0@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/mips/include/asm/syscall.h