mips: fix syscall_get_nr
Subsystems (2)
PATCH 1/1 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 201766a20e30f ("ptrace: add PTRACE_GET_SYSCALL_INFO request") and detected by strace test suite.
--- arch/mips/include/asm/syscall.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/include/asm/syscall.h +1 -1
@@ -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,
Quoted 23 lines · Elvira Khabirova
The implementation of
syscall_get_nron 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: addPTRACE_GET_SYSCALL_INFOrequest") and detected by strace test suite.Fixes c2d9f1775731 ("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]>--- arch/mips/include/asm/syscall.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/mips/include/asm/syscall.h +0
-0
arch/mips/include/asm/syscall.h static inline bool mips_syscall_is_indirect(struct task_struct *task, · line 44
Quoted 8 lines
arch/mips/include/asm/syscall.h +1
-1@@ -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,
applied to mips-next.
Thomas.
Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]