From: JP Abgrall Date: Thu, 18 Sep 2014 01:18:11 +0000 (-0700) Subject: arm64: audit: Add audit hook in syscall_trace_enter/exit() X-Git-Tag: firefly_0821_release~4090^2~195 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3e21c0bb663a23436e0eb3f61860d4fedc233bab;p=firefly-linux-kernel-4.4.55.git arm64: audit: Add audit hook in syscall_trace_enter/exit() This patch adds auditing functions on entry to or exit from every system call invocation. Acked-by: Richard Guy Briggs Acked-by Will Deacon Signed-off-by: AKASHI Takahiro Signed-off-by: Catalin Marinas Conflicts: arch/arm64/kernel/ptrace.c Change-Id: I7ebff5df4acbdab56c74e584dbc5fef5d8bfc9a8 --- diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c index f3b14fd27ab4..ee856d9f6f64 100644 --- a/arch/arm64/kernel/ptrace.c +++ b/arch/arm64/kernel/ptrace.c @@ -19,6 +19,8 @@ * along with this program. If not, see . */ +#include +#include #include #include #include @@ -38,6 +40,7 @@ #include #include #include +#include #include #include @@ -1096,11 +1099,16 @@ asmlinkage int syscall_trace_enter(struct pt_regs *regs) if (test_thread_flag(TIF_SYSCALL_TRACE)) tracehook_report_syscall(regs, PTRACE_SYSCALL_ENTER); + audit_syscall_entry(syscall_get_arch(), regs->syscallno, + regs->orig_x0, regs->regs[1], regs->regs[2], regs->regs[3]); + return regs->syscallno; } asmlinkage void syscall_trace_exit(struct pt_regs *regs) { + audit_syscall_exit(regs); + if (test_thread_flag(TIF_SYSCALL_TRACE)) tracehook_report_syscall(regs, PTRACE_SYSCALL_EXIT); }