summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorElvira Khabirova <lineprinter0@gmail.com>2023-02-18 23:43:59 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-11 16:31:53 +0100
commitd1aef0928c8f79b049dd003e47ded646481716c3 (patch)
treeac95ecfa329fff0728eb3ed7eea57c2fec77360b /arch
parent45c907f14dc1c0e8e640a95f5a8aa77dadbc035c (diff)
downloadlinux-d1aef0928c8f79b049dd003e47ded646481716c3.tar.gz
linux-d1aef0928c8f79b049dd003e47ded646481716c3.tar.bz2
linux-d1aef0928c8f79b049dd003e47ded646481716c3.zip
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 201766a20e30f ("ptrace: add PTRACE_GET_SYSCALL_INFO request") and detected by strace test suite. Link: https://github.com/strace/strace/issues/235 Fixes: c2d9f1775731 ("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>
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/include/asm/syscall.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/mips/include/asm/syscall.h b/arch/mips/include/asm/syscall.h
index 6cf8ffb5367e..94d8c945ea8e 100644
--- a/arch/mips/include/asm/syscall.h
+++ b/arch/mips/include/asm/syscall.h
@@ -38,7 +38,7 @@ static inline bool mips_syscall_is_indirect(struct task_struct *task,
static inline long syscall_get_nr(struct task_struct *task,
struct pt_regs *regs)
{
- return current_thread_info()->syscall;
+ return task_thread_info(task)->syscall;
}
static inline void mips_syscall_update_nr(struct task_struct *task,