Skip to content

Commit 85cc91e

Browse files
parport0tsbogend
authored andcommitted
mips: fix syscall_get_nr
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 201766a ("ptrace: add PTRACE_GET_SYSCALL_INFO request") and detected by strace test suite. Link: strace/strace#235 Fixes: c2d9f17 ("MIPS: Fix syscall_get_nr for the syscall exit tracing.") Cc: <[email protected]> # v3.19+ Co-developed-by: Dmitry V. Levin <[email protected]> Signed-off-by: Dmitry V. Levin <[email protected]> Signed-off-by: Elvira Khabirova <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]>
1 parent 6f02e39 commit 85cc91e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/mips/include/asm/syscall.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ static inline bool mips_syscall_is_indirect(struct task_struct *task,
3838
static inline long syscall_get_nr(struct task_struct *task,
3939
struct pt_regs *regs)
4040
{
41-
return current_thread_info()->syscall;
41+
return task_thread_info(task)->syscall;
4242
}
4343

4444
static inline void mips_syscall_update_nr(struct task_struct *task,

0 commit comments

Comments
 (0)