Commit 8d74ea0e authored by Markos Chandras's avatar Markos Chandras Committed by Ralf Baechle

MIPS: syscall: Fix AUDIT value for O32 processes on MIPS64

On MIPS64, O32 processes set both TIF_32BIT_ADDR and
TIF_32BIT_REGS so the previous condition treated O32 applications
as N32 when evaluating seccomp filters. Fix the condition to check
both TIF_32BIT_{REGS, ADDR} for the N32 AUDIT flag.
Signed-off-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
Patchwork: http://patchwork.linux-mips.org/patch/7480/
Cc: <stable@vger.kernel.org> # v3.15+
Signed-off-by: default avatarJames Hogan <james.hogan@imgtec.com>
parent 7ff1740f
...@@ -131,10 +131,12 @@ static inline int syscall_get_arch(void) ...@@ -131,10 +131,12 @@ static inline int syscall_get_arch(void)
{ {
int arch = EM_MIPS; int arch = EM_MIPS;
#ifdef CONFIG_64BIT #ifdef CONFIG_64BIT
if (!test_thread_flag(TIF_32BIT_REGS)) if (!test_thread_flag(TIF_32BIT_REGS)) {
arch |= __AUDIT_ARCH_64BIT; arch |= __AUDIT_ARCH_64BIT;
if (test_thread_flag(TIF_32BIT_ADDR)) /* N32 sets only TIF_32BIT_ADDR */
arch |= __AUDIT_ARCH_CONVENTION_MIPS64_N32; if (test_thread_flag(TIF_32BIT_ADDR))
arch |= __AUDIT_ARCH_CONVENTION_MIPS64_N32;
}
#endif #endif
#if defined(__LITTLE_ENDIAN) #if defined(__LITTLE_ENDIAN)
arch |= __AUDIT_ARCH_LE; arch |= __AUDIT_ARCH_LE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment