From 3e21c0bb663a23436e0eb3f61860d4fedc233bab Mon Sep 17 00:00:00 2001 From: JP Abgrall Date: Wed, 17 Sep 2014 18:18:11 -0700 Subject: [PATCH] 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 --- arch/arm64/kernel/ptrace.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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); } -- 2.34.1