Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mips: fix mips_get_syscall_arg o32 check

When checking for TIF_32BIT_REGS flag, mips_get_syscall_arg() should
use the task specified as its argument instead of the current task.

This potentially affects all syscall_get_arguments() users
who specify tasks different from the current.

Fixes: c0ff3c53d4f99 ("MIPS: Enable HAVE_ARCH_TRACEHOOK.")
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Patchwork: https://patchwork.linux-mips.org/patch/21185/
Cc: Elvira Khabirova <lineprinter@altlinux.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org # v3.13+

authored by

Dmitry V. Levin and committed by
Paul Burton
c50cbd85 1229ace4

+1 -1
+1 -1
arch/mips/include/asm/syscall.h
··· 73 73 #ifdef CONFIG_64BIT 74 74 case 4: case 5: case 6: case 7: 75 75 #ifdef CONFIG_MIPS32_O32 76 - if (test_thread_flag(TIF_32BIT_REGS)) 76 + if (test_tsk_thread_flag(task, TIF_32BIT_REGS)) 77 77 return get_user(*arg, (int *)usp + n); 78 78 else 79 79 #endif