1 From 40381529f84c4cda3bd2d20cab6a707508856b21 Mon Sep 17 00:00:00 2001
2 From: Markos Chandras <markos.chandras@imgtec.com>
3 Date: Thu, 24 Jul 2014 12:10:01 +0100
4 Subject: MIPS: syscall: Fix AUDIT value for O32 processes on MIPS64
6 From: Markos Chandras <markos.chandras@imgtec.com>
8 commit 40381529f84c4cda3bd2d20cab6a707508856b21 upstream.
10 On MIPS64, O32 processes set both TIF_32BIT_ADDR and
11 TIF_32BIT_REGS so the previous condition treated O32 applications
12 as N32 when evaluating seccomp filters. Fix the condition to check
13 both TIF_32BIT_{REGS, ADDR} for the N32 AUDIT flag.
15 Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
16 Patchwork: http://patchwork.linux-mips.org/patch/7480/
17 Signed-off-by: James Hogan <james.hogan@imgtec.com>
18 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
21 arch/mips/include/asm/syscall.h | 8 +++++---
22 1 file changed, 5 insertions(+), 3 deletions(-)
24 --- a/arch/mips/include/asm/syscall.h
25 +++ b/arch/mips/include/asm/syscall.h
26 @@ -131,10 +131,12 @@ static inline int syscall_get_arch(void)
30 - if (!test_thread_flag(TIF_32BIT_REGS))
31 + if (!test_thread_flag(TIF_32BIT_REGS)) {
32 arch |= __AUDIT_ARCH_64BIT;
33 - if (test_thread_flag(TIF_32BIT_ADDR))
34 - arch |= __AUDIT_ARCH_CONVENTION_MIPS64_N32;
35 + /* N32 sets only TIF_32BIT_ADDR */
36 + if (test_thread_flag(TIF_32BIT_ADDR))
37 + arch |= __AUDIT_ARCH_CONVENTION_MIPS64_N32;
40 #if defined(__LITTLE_ENDIAN)
41 arch |= __AUDIT_ARCH_LE;