aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAKASHI Takahiro <takahiro.akashi@linaro.org>2014-07-04 03:28:30 -0400
committerCatalin Marinas <catalin.marinas@arm.com>2014-07-10 06:06:00 -0400
commit875cbf3e4614cfdcc7f65033e25292aec80f09c0 (patch)
tree08fdfc968a42afb6b67ddd13fe8ede7a70dbe975
parent5701ede884c2221e6ebbb54aec83dc433287bc50 (diff)
arm64: Add audit support
On AArch64, audit is supported through generic lib/audit.c and compat_audit.c, and so this patch adds arch specific definitions required. Acked-by Will Deacon <will.deacon@arm.com> Acked-by: Richard Guy Briggs <rgb@redhat.com> Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
-rw-r--r--arch/arm64/Kconfig2
-rw-r--r--arch/arm64/include/asm/syscall.h14
-rw-r--r--include/uapi/linux/audit.h1
3 files changed, 17 insertions, 0 deletions
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 1cb806529393..ce6e733e0c05 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -10,6 +10,7 @@ config ARM64
10 select ARM_AMBA 10 select ARM_AMBA
11 select ARM_ARCH_TIMER 11 select ARM_ARCH_TIMER
12 select ARM_GIC 12 select ARM_GIC
13 select AUDIT_ARCH_COMPAT_GENERIC
13 select BUILDTIME_EXTABLE_SORT 14 select BUILDTIME_EXTABLE_SORT
14 select CLONE_BACKWARDS 15 select CLONE_BACKWARDS
15 select COMMON_CLK 16 select COMMON_CLK
@@ -28,6 +29,7 @@ config ARM64
28 select GENERIC_STRNLEN_USER 29 select GENERIC_STRNLEN_USER
29 select GENERIC_TIME_VSYSCALL 30 select GENERIC_TIME_VSYSCALL
30 select HARDIRQS_SW_RESEND 31 select HARDIRQS_SW_RESEND
32 select HAVE_ARCH_AUDITSYSCALL
31 select HAVE_ARCH_JUMP_LABEL 33 select HAVE_ARCH_JUMP_LABEL
32 select HAVE_ARCH_KGDB 34 select HAVE_ARCH_KGDB
33 select HAVE_ARCH_TRACEHOOK 35 select HAVE_ARCH_TRACEHOOK
diff --git a/arch/arm64/include/asm/syscall.h b/arch/arm64/include/asm/syscall.h
index 383771eb0b87..709a574468f0 100644
--- a/arch/arm64/include/asm/syscall.h
+++ b/arch/arm64/include/asm/syscall.h
@@ -16,6 +16,8 @@
16#ifndef __ASM_SYSCALL_H 16#ifndef __ASM_SYSCALL_H
17#define __ASM_SYSCALL_H 17#define __ASM_SYSCALL_H
18 18
19#include <uapi/linux/audit.h>
20#include <linux/compat.h>
19#include <linux/err.h> 21#include <linux/err.h>
20 22
21extern const void *sys_call_table[]; 23extern const void *sys_call_table[];
@@ -105,4 +107,16 @@ static inline void syscall_set_arguments(struct task_struct *task,
105 memcpy(&regs->regs[i], args, n * sizeof(args[0])); 107 memcpy(&regs->regs[i], args, n * sizeof(args[0]));
106} 108}
107 109
110/*
111 * We don't care about endianness (__AUDIT_ARCH_LE bit) here because
112 * AArch64 has the same system calls both on little- and big- endian.
113 */
114static inline int syscall_get_arch(void)
115{
116 if (is_compat_task())
117 return AUDIT_ARCH_ARM;
118
119 return AUDIT_ARCH_AARCH64;
120}
121
108#endif /* __ASM_SYSCALL_H */ 122#endif /* __ASM_SYSCALL_H */
diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h
index cf6714752b69..3b9ff33e1768 100644
--- a/include/uapi/linux/audit.h
+++ b/include/uapi/linux/audit.h
@@ -342,6 +342,7 @@ enum {
342#define __AUDIT_ARCH_64BIT 0x80000000 342#define __AUDIT_ARCH_64BIT 0x80000000
343#define __AUDIT_ARCH_LE 0x40000000 343#define __AUDIT_ARCH_LE 0x40000000
344 344
345#define AUDIT_ARCH_AARCH64 (EM_AARCH64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
345#define AUDIT_ARCH_ALPHA (EM_ALPHA|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) 346#define AUDIT_ARCH_ALPHA (EM_ALPHA|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
346#define AUDIT_ARCH_ARM (EM_ARM|__AUDIT_ARCH_LE) 347#define AUDIT_ARCH_ARM (EM_ARM|__AUDIT_ARCH_LE)
347#define AUDIT_ARCH_ARMEB (EM_ARM) 348#define AUDIT_ARCH_ARMEB (EM_ARM)