Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

AKASHI Takahiro and committed by
Catalin Marinas
875cbf3e 5701ede8

+17
+2
arch/arm64/Kconfig
··· 10 10 select ARM_AMBA 11 11 select ARM_ARCH_TIMER 12 12 select ARM_GIC 13 + select AUDIT_ARCH_COMPAT_GENERIC 13 14 select BUILDTIME_EXTABLE_SORT 14 15 select CLONE_BACKWARDS 15 16 select COMMON_CLK ··· 29 28 select GENERIC_STRNLEN_USER 30 29 select GENERIC_TIME_VSYSCALL 31 30 select HARDIRQS_SW_RESEND 31 + select HAVE_ARCH_AUDITSYSCALL 32 32 select HAVE_ARCH_JUMP_LABEL 33 33 select HAVE_ARCH_KGDB 34 34 select HAVE_ARCH_TRACEHOOK
+14
arch/arm64/include/asm/syscall.h
··· 16 16 #ifndef __ASM_SYSCALL_H 17 17 #define __ASM_SYSCALL_H 18 18 19 + #include <uapi/linux/audit.h> 20 + #include <linux/compat.h> 19 21 #include <linux/err.h> 20 22 21 23 extern const void *sys_call_table[]; ··· 105 103 } 106 104 107 105 memcpy(&regs->regs[i], args, n * sizeof(args[0])); 106 + } 107 + 108 + /* 109 + * We don't care about endianness (__AUDIT_ARCH_LE bit) here because 110 + * AArch64 has the same system calls both on little- and big- endian. 111 + */ 112 + static inline int syscall_get_arch(void) 113 + { 114 + if (is_compat_task()) 115 + return AUDIT_ARCH_ARM; 116 + 117 + return AUDIT_ARCH_AARCH64; 108 118 } 109 119 110 120 #endif /* __ASM_SYSCALL_H */
+1
include/uapi/linux/audit.h
··· 342 342 #define __AUDIT_ARCH_64BIT 0x80000000 343 343 #define __AUDIT_ARCH_LE 0x40000000 344 344 345 + #define AUDIT_ARCH_AARCH64 (EM_AARCH64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) 345 346 #define AUDIT_ARCH_ALPHA (EM_ALPHA|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) 346 347 #define AUDIT_ARCH_ARM (EM_ARM|__AUDIT_ARCH_LE) 347 348 #define AUDIT_ARCH_ARMEB (EM_ARM)