]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.16.3/mips-syscall-fix-audit-value-for-o32-processes-on-mips64.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.16.3 / mips-syscall-fix-audit-value-for-o32-processes-on-mips64.patch
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
5
6 From: Markos Chandras <markos.chandras@imgtec.com>
7
8 commit 40381529f84c4cda3bd2d20cab6a707508856b21 upstream.
9
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.
14
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>
19
20 ---
21 arch/mips/include/asm/syscall.h | 8 +++++---
22 1 file changed, 5 insertions(+), 3 deletions(-)
23
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)
27 {
28 int arch = EM_MIPS;
29 #ifdef CONFIG_64BIT
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;
38 + }
39 #endif
40 #if defined(__LITTLE_ENDIAN)
41 arch |= __AUDIT_ARCH_LE;