aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/kernel/ptrace.c
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@shinybook.infradead.org>2005-05-03 14:11:02 +0100
committerDavid Woodhouse <dwmw2@shinybook.infradead.org>2005-05-03 14:11:02 +0100
commit488f2eaca1b0831a5a5e6a66e33bad2cdeff7238 (patch)
treea7d9c0e8722194ca92602ad0d5982fbb1e9e9d8e /arch/x86_64/kernel/ptrace.c
parent0dd8e06bdaa0a97e706ee1a489a1f6176c4ddc64 (diff)
[AUDIT] Log correct syscall args for i386 processes on x86_64
The i386 syscall ABI uses different registers. Log those instead of the x86_64 ones. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'arch/x86_64/kernel/ptrace.c')
-rw-r--r--arch/x86_64/kernel/ptrace.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/arch/x86_64/kernel/ptrace.c b/arch/x86_64/kernel/ptrace.c
index 19eba9aaedd..e26e86bb56f 100644
--- a/arch/x86_64/kernel/ptrace.c
+++ b/arch/x86_64/kernel/ptrace.c
@@ -630,8 +630,6 @@ static void syscall_trace(struct pt_regs *regs)
}
}
-#define audit_arch() (test_thread_flag(TIF_IA32) ? AUDIT_ARCH_I386 : AUDIT_ARCH_X86_64)
-
asmlinkage void syscall_trace_enter(struct pt_regs *regs)
{
/* do the secure computing check first */
@@ -641,11 +639,19 @@ asmlinkage void syscall_trace_enter(struct pt_regs *regs)
&& (current->ptrace & PT_PTRACED))
syscall_trace(regs);
- if (unlikely(current->audit_context))
- audit_syscall_entry(current, audit_arch(), regs->orig_rax,
- regs->rdi, regs->rsi,
- regs->rdx, regs->r10);
-
+ if (unlikely(current->audit_context)) {
+ if (test_thread_flag(TIF_IA32)) {
+ audit_syscall_entry(current, AUDIT_ARCH_I386,
+ regs->orig_rax,
+ regs->rbx, regs->rcx,
+ regs->rdx, regs->rsi);
+ } else {
+ audit_syscall_entry(current, AUDIT_ARCH_X86_64,
+ regs->orig_rax,
+ regs->rdi, regs->rsi,
+ regs->rdx, regs->r10);
+ }
+ }
}
asmlinkage void syscall_trace_leave(struct pt_regs *regs)