Skip to content

Commit

Permalink
ARM: 7525/1: ptrace: use updated syscall number for syscall auditing
Browse files Browse the repository at this point in the history
When tracing system calls, a debugger may change the syscall number
in response to a SIGTRAP on syscall entry.

This patch ensures that the new syscall number is passed to the audit
code.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Will Deacon authored and Russell King committed Sep 19, 2012
1 parent 1f66e06 commit ebb5e15
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions arch/arm/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -944,19 +944,19 @@ static int ptrace_syscall_trace(struct pt_regs *regs, int scno,

asmlinkage int syscall_trace_enter(struct pt_regs *regs, int scno)
{
int ret = ptrace_syscall_trace(regs, scno, PTRACE_SYSCALL_ENTER);
scno = ptrace_syscall_trace(regs, scno, PTRACE_SYSCALL_ENTER);
if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
trace_sys_enter(regs, ret);
trace_sys_enter(regs, scno);
audit_syscall_entry(AUDIT_ARCH_ARM, scno, regs->ARM_r0, regs->ARM_r1,
regs->ARM_r2, regs->ARM_r3);
return ret;
return scno;
}

asmlinkage int syscall_trace_exit(struct pt_regs *regs, int scno)
{
int ret = ptrace_syscall_trace(regs, scno, PTRACE_SYSCALL_EXIT);
scno = ptrace_syscall_trace(regs, scno, PTRACE_SYSCALL_EXIT);
if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
trace_sys_exit(regs, ret);
trace_sys_exit(regs, scno);
audit_syscall_exit(regs);
return ret;
return scno;
}

0 comments on commit ebb5e15

Please sign in to comment.