]> 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>
Fri, 10 Mar 2023 08:34:26 +0000 (09:34 +0100)
commit5630a78ced252bb39310e3c14667b6c447890214
tree62f1e81a0e318bdfaf102633e45c17b197bf3b14
parentffd00cbcfde42ff0b9b13001b2b1d16a98462567
mips: fix syscall_get_nr

commit 52390aef66e5e90f960f6d5610d5bfeb00081e5e 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