aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/ia64/include/asm/syscall.h6
-rw-r--r--arch/microblaze/include/asm/syscall.h5
-rw-r--r--arch/mips/include/asm/syscall.h2
-rw-r--r--arch/openrisc/include/asm/syscall.h5
-rw-r--r--arch/parisc/include/asm/syscall.h11
-rw-r--r--arch/powerpc/include/asm/syscall.h12
-rw-r--r--arch/sparc/include/asm/syscall.h8
-rw-r--r--include/uapi/linux/audit.h1
8 files changed, 49 insertions, 1 deletions
diff --git a/arch/ia64/include/asm/syscall.h b/arch/ia64/include/asm/syscall.h
index a7ff1c6ab068..1d0b875fec44 100644
--- a/arch/ia64/include/asm/syscall.h
+++ b/arch/ia64/include/asm/syscall.h
@@ -13,6 +13,7 @@
13#ifndef _ASM_SYSCALL_H 13#ifndef _ASM_SYSCALL_H
14#define _ASM_SYSCALL_H 1 14#define _ASM_SYSCALL_H 1
15 15
16#include <uapi/linux/audit.h>
16#include <linux/sched.h> 17#include <linux/sched.h>
17#include <linux/err.h> 18#include <linux/err.h>
18 19
@@ -79,4 +80,9 @@ static inline void syscall_set_arguments(struct task_struct *task,
79 80
80 ia64_syscall_get_set_arguments(task, regs, i, n, args, 1); 81 ia64_syscall_get_set_arguments(task, regs, i, n, args, 1);
81} 82}
83
84static inline int syscall_get_arch(void)
85{
86 return AUDIT_ARCH_IA64;
87}
82#endif /* _ASM_SYSCALL_H */ 88#endif /* _ASM_SYSCALL_H */
diff --git a/arch/microblaze/include/asm/syscall.h b/arch/microblaze/include/asm/syscall.h
index 9bc431783105..53cfaf34c343 100644
--- a/arch/microblaze/include/asm/syscall.h
+++ b/arch/microblaze/include/asm/syscall.h
@@ -1,6 +1,7 @@
1#ifndef __ASM_MICROBLAZE_SYSCALL_H 1#ifndef __ASM_MICROBLAZE_SYSCALL_H
2#define __ASM_MICROBLAZE_SYSCALL_H 2#define __ASM_MICROBLAZE_SYSCALL_H
3 3
4#include <uapi/linux/audit.h>
4#include <linux/kernel.h> 5#include <linux/kernel.h>
5#include <linux/sched.h> 6#include <linux/sched.h>
6#include <asm/ptrace.h> 7#include <asm/ptrace.h>
@@ -99,4 +100,8 @@ static inline void syscall_set_arguments(struct task_struct *task,
99asmlinkage long do_syscall_trace_enter(struct pt_regs *regs); 100asmlinkage long do_syscall_trace_enter(struct pt_regs *regs);
100asmlinkage void do_syscall_trace_leave(struct pt_regs *regs); 101asmlinkage void do_syscall_trace_leave(struct pt_regs *regs);
101 102
103static inline int syscall_get_arch(void)
104{
105 return AUDIT_ARCH_MICROBLAZE;
106}
102#endif /* __ASM_MICROBLAZE_SYSCALL_H */ 107#endif /* __ASM_MICROBLAZE_SYSCALL_H */
diff --git a/arch/mips/include/asm/syscall.h b/arch/mips/include/asm/syscall.h
index 17960fe7a8ce..93b3b86c293c 100644
--- a/arch/mips/include/asm/syscall.h
+++ b/arch/mips/include/asm/syscall.h
@@ -129,7 +129,7 @@ extern const unsigned long sysn32_call_table[];
129 129
130static inline int syscall_get_arch(void) 130static inline int syscall_get_arch(void)
131{ 131{
132 int arch = EM_MIPS; 132 int arch = AUDIT_ARCH_MIPS;
133#ifdef CONFIG_64BIT 133#ifdef CONFIG_64BIT
134 if (!test_thread_flag(TIF_32BIT_REGS)) 134 if (!test_thread_flag(TIF_32BIT_REGS))
135 arch |= __AUDIT_ARCH_64BIT; 135 arch |= __AUDIT_ARCH_64BIT;
diff --git a/arch/openrisc/include/asm/syscall.h b/arch/openrisc/include/asm/syscall.h
index b752bb67891d..2db9f1cf0694 100644
--- a/arch/openrisc/include/asm/syscall.h
+++ b/arch/openrisc/include/asm/syscall.h
@@ -19,6 +19,7 @@
19#ifndef __ASM_OPENRISC_SYSCALL_H__ 19#ifndef __ASM_OPENRISC_SYSCALL_H__
20#define __ASM_OPENRISC_SYSCALL_H__ 20#define __ASM_OPENRISC_SYSCALL_H__
21 21
22#include <uapi/linux/audit.h>
22#include <linux/err.h> 23#include <linux/err.h>
23#include <linux/sched.h> 24#include <linux/sched.h>
24 25
@@ -71,4 +72,8 @@ syscall_set_arguments(struct task_struct *task, struct pt_regs *regs,
71 memcpy(&regs->gpr[3 + i], args, n * sizeof(args[0])); 72 memcpy(&regs->gpr[3 + i], args, n * sizeof(args[0]));
72} 73}
73 74
75static inline int syscall_get_arch(void)
76{
77 return AUDIT_ARCH_OPENRISC;
78}
74#endif 79#endif
diff --git a/arch/parisc/include/asm/syscall.h b/arch/parisc/include/asm/syscall.h
index 8bdfd2c8c39f..a5eba95d87fe 100644
--- a/arch/parisc/include/asm/syscall.h
+++ b/arch/parisc/include/asm/syscall.h
@@ -3,6 +3,8 @@
3#ifndef _ASM_PARISC_SYSCALL_H_ 3#ifndef _ASM_PARISC_SYSCALL_H_
4#define _ASM_PARISC_SYSCALL_H_ 4#define _ASM_PARISC_SYSCALL_H_
5 5
6#include <uapi/linux/audit.h>
7#include <linux/compat.h>
6#include <linux/err.h> 8#include <linux/err.h>
7#include <asm/ptrace.h> 9#include <asm/ptrace.h>
8 10
@@ -37,4 +39,13 @@ static inline void syscall_get_arguments(struct task_struct *tsk,
37 } 39 }
38} 40}
39 41
42static inline int syscall_get_arch(void)
43{
44 int arch = AUDIT_ARCH_PARISC;
45#ifdef CONFIG_64BIT
46 if (!is_compat_task())
47 arch = AUDIT_ARCH_PARISC64;
48#endif
49 return arch;
50}
40#endif /*_ASM_PARISC_SYSCALL_H_*/ 51#endif /*_ASM_PARISC_SYSCALL_H_*/
diff --git a/arch/powerpc/include/asm/syscall.h b/arch/powerpc/include/asm/syscall.h
index b54b2add07be..427154444f6d 100644
--- a/arch/powerpc/include/asm/syscall.h
+++ b/arch/powerpc/include/asm/syscall.h
@@ -13,6 +13,8 @@
13#ifndef _ASM_SYSCALL_H 13#ifndef _ASM_SYSCALL_H
14#define _ASM_SYSCALL_H 1 14#define _ASM_SYSCALL_H 1
15 15
16#include <uapi/linux/audit.h>
17#include <linux/compat.h>
16#include <linux/sched.h> 18#include <linux/sched.h>
17 19
18/* ftrace syscalls requires exporting the sys_call_table */ 20/* ftrace syscalls requires exporting the sys_call_table */
@@ -86,4 +88,14 @@ static inline void syscall_set_arguments(struct task_struct *task,
86 memcpy(&regs->gpr[3 + i], args, n * sizeof(args[0])); 88 memcpy(&regs->gpr[3 + i], args, n * sizeof(args[0]));
87} 89}
88 90
91static inline int syscall_get_arch(void)
92{
93 int arch = AUDIT_ARCH_PPC;
94
95#ifdef CONFIG_PPC64
96 if (!is_32bit_task())
97 arch = AUDIT_ARCH_PPC64;
98#endif
99 return arch;
100}
89#endif /* _ASM_SYSCALL_H */ 101#endif /* _ASM_SYSCALL_H */
diff --git a/arch/sparc/include/asm/syscall.h b/arch/sparc/include/asm/syscall.h
index 025a02ad2e31..fed3d511b108 100644
--- a/arch/sparc/include/asm/syscall.h
+++ b/arch/sparc/include/asm/syscall.h
@@ -1,9 +1,11 @@
1#ifndef __ASM_SPARC_SYSCALL_H 1#ifndef __ASM_SPARC_SYSCALL_H
2#define __ASM_SPARC_SYSCALL_H 2#define __ASM_SPARC_SYSCALL_H
3 3
4#include <uapi/linux/audit.h>
4#include <linux/kernel.h> 5#include <linux/kernel.h>
5#include <linux/sched.h> 6#include <linux/sched.h>
6#include <asm/ptrace.h> 7#include <asm/ptrace.h>
8#include <asm/thread_info.h>
7 9
8/* 10/*
9 * The syscall table always contains 32 bit pointers since we know that the 11 * The syscall table always contains 32 bit pointers since we know that the
@@ -124,4 +126,10 @@ static inline void syscall_set_arguments(struct task_struct *task,
124 regs->u_regs[UREG_I0 + i + j] = args[j]; 126 regs->u_regs[UREG_I0 + i + j] = args[j];
125} 127}
126 128
129static inline int syscall_get_arch(void)
130{
131 return test_thread_flag(TIF_32BIT) ? AUDIT_ARCH_SPARC
132 : AUDIT_ARCH_SPARC64;
133}
134
127#endif /* __ASM_SPARC_SYSCALL_H */ 135#endif /* __ASM_SPARC_SYSCALL_H */
diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h
index df71b1d2cbb8..4d100c841c80 100644
--- a/include/uapi/linux/audit.h
+++ b/include/uapi/linux/audit.h
@@ -351,6 +351,7 @@ enum {
351#define AUDIT_ARCH_IA64 (EM_IA_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) 351#define AUDIT_ARCH_IA64 (EM_IA_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
352#define AUDIT_ARCH_M32R (EM_M32R) 352#define AUDIT_ARCH_M32R (EM_M32R)
353#define AUDIT_ARCH_M68K (EM_68K) 353#define AUDIT_ARCH_M68K (EM_68K)
354#define AUDIT_ARCH_MICROBLAZE (EM_MICROBLAZE)
354#define AUDIT_ARCH_MIPS (EM_MIPS) 355#define AUDIT_ARCH_MIPS (EM_MIPS)
355#define AUDIT_ARCH_MIPSEL (EM_MIPS|__AUDIT_ARCH_LE) 356#define AUDIT_ARCH_MIPSEL (EM_MIPS|__AUDIT_ARCH_LE)
356#define AUDIT_ARCH_MIPS64 (EM_MIPS|__AUDIT_ARCH_64BIT) 357#define AUDIT_ARCH_MIPS64 (EM_MIPS|__AUDIT_ARCH_64BIT)