Skip to content

Commit 5701ede

Browse files
AKASHI Takahiroctmarinas
authored andcommitted
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 <rgb@redhat.com> Acked-by Will Deacon <will.deacon@arm.com> Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent f3e5c84 commit 5701ede

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎arch/arm64/kernel/ptrace.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
* along with this program. If not, see <http://www.gnu.org/licenses/>.
2020
*/
2121

22+
#include <linux/audit.h>
2223
#include <linux/compat.h>
2324
#include <linux/kernel.h>
2425
#include <linux/sched.h>
@@ -39,6 +40,7 @@
3940
#include <asm/compat.h>
4041
#include <asm/debug-monitors.h>
4142
#include <asm/pgtable.h>
43+
#include <asm/syscall.h>
4244
#include <asm/traps.h>
4345
#include <asm/system_misc.h>
4446

@@ -1113,11 +1115,16 @@ asmlinkage int syscall_trace_enter(struct pt_regs *regs)
11131115
if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
11141116
trace_sys_enter(regs, regs->syscallno);
11151117

1118+
audit_syscall_entry(syscall_get_arch(), regs->syscallno,
1119+
regs->orig_x0, regs->regs[1], regs->regs[2], regs->regs[3]);
1120+
11161121
return regs->syscallno;
11171122
}
11181123

11191124
asmlinkage void syscall_trace_exit(struct pt_regs *regs)
11201125
{
1126+
audit_syscall_exit(regs);
1127+
11211128
if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
11221129
trace_sys_exit(regs, regs_return_value(regs));
11231130

0 commit comments

Comments
 (0)