summaryrefslogtreecommitdiffstats
path: root/arch/mips/include/asm/syscall.h
diff options
context:
space:
mode:
authorMarkos Chandras <markos.chandras@imgtec.com>2014-07-24 12:10:01 +0100
committerRalf Baechle <ralf@linux-mips.org>2014-08-19 18:24:39 +0200
commit40381529f84c4cda3bd2d20cab6a707508856b21 (patch)
tree6705ac7d22a0a1ccaa95f5f192329ef8e77e6bdd /arch/mips/include/asm/syscall.h
parentbfcdf1306361951b104c6858d07f6778b53e4368 (diff)
downloadop-kernel-dev-40381529f84c4cda3bd2d20cab6a707508856b21.zip
op-kernel-dev-40381529f84c4cda3bd2d20cab6a707508856b21.tar.gz
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: Markos Chandras <markos.chandras@imgtec.com> Patchwork: http://patchwork.linux-mips.org/patch/7480/ Cc: <stable@vger.kernel.org> # v3.15+ Signed-off-by: James Hogan <james.hogan@imgtec.com>
Diffstat (limited to 'arch/mips/include/asm/syscall.h')
-rw-r--r--arch/mips/include/asm/syscall.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/mips/include/asm/syscall.h b/arch/mips/include/asm/syscall.h
index 17960fe..cdf68b3 100644
--- 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;
OpenPOWER on IntegriCloud