3.16-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Markos Chandras <markos.chand...@imgtec.com>

commit 40381529f84c4cda3bd2d20cab6a707508856b21 upstream.

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: Markos Chandras <markos.chand...@imgtec.com>
Patchwork: http://patchwork.linux-mips.org/patch/7480/
Signed-off-by: James Hogan <james.ho...@imgtec.com>
Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>

---
 arch/mips/include/asm/syscall.h |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

--- a/arch/mips/include/asm/syscall.h
+++ b/arch/mips/include/asm/syscall.h
@@ -131,10 +131,12 @@ static inline int syscall_get_arch(void)
 {
        int arch = EM_MIPS;
 #ifdef CONFIG_64BIT
-       if (!test_thread_flag(TIF_32BIT_REGS))
+       if (!test_thread_flag(TIF_32BIT_REGS)) {
                arch |= __AUDIT_ARCH_64BIT;
-       if (test_thread_flag(TIF_32BIT_ADDR))
-               arch |= __AUDIT_ARCH_CONVENTION_MIPS64_N32;
+               /* N32 sets only TIF_32BIT_ADDR */
+               if (test_thread_flag(TIF_32BIT_ADDR))
+                       arch |= __AUDIT_ARCH_CONVENTION_MIPS64_N32;
+       }
 #endif
 #if defined(__LITTLE_ENDIAN)
        arch |=  __AUDIT_ARCH_LE;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to