summaryrefslogtreecommitdiff
path: root/arch/riscv
diff options
context:
space:
mode:
authorDavid Abdurachmanov <david.abdurachmanov@gmail.com>2018-10-29 13:48:54 +0300
committerPalmer Dabbelt <palmer@sifive.com>2019-01-07 19:22:40 +0300
commit0aea89430a4c79c65c541c947497007d33fbe002 (patch)
tree7318444d5544bda424b8712446abbecfecbc4ece /arch/riscv
parentefe75c494f57890900caf6c8a0667db35bfaf56a (diff)
downloadlinux-0aea89430a4c79c65c541c947497007d33fbe002.tar.xz
riscv: audit: add audit hook in do_syscall_trace_enter/exit()
This patch adds auditing functions on entry to and exit from every system call invocation. Signed-off-by: David Abdurachmanov <david.abdurachmanov@gmail.com> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
Diffstat (limited to 'arch/riscv')
-rw-r--r--arch/riscv/kernel/ptrace.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/riscv/kernel/ptrace.c b/arch/riscv/kernel/ptrace.c
index 60f1e02eed36..c1b51539c3e2 100644
--- a/arch/riscv/kernel/ptrace.c
+++ b/arch/riscv/kernel/ptrace.c
@@ -18,6 +18,7 @@
#include <asm/ptrace.h>
#include <asm/syscall.h>
#include <asm/thread_info.h>
+#include <linux/audit.h>
#include <linux/ptrace.h>
#include <linux/elf.h>
#include <linux/regset.h>
@@ -163,10 +164,14 @@ void do_syscall_trace_enter(struct pt_regs *regs)
if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
trace_sys_enter(regs, syscall_get_nr(current, regs));
#endif
+
+ audit_syscall_entry(regs->a7, regs->a0, regs->a1, regs->a2, regs->a3);
}
void do_syscall_trace_exit(struct pt_regs *regs)
{
+ audit_syscall_exit(regs);
+
if (test_thread_flag(TIF_SYSCALL_TRACE))
tracehook_report_syscall_exit(regs, 0);