diff options
Diffstat (limited to 'arch/i386')
-rw-r--r-- | arch/i386/kernel/ptrace.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/arch/i386/kernel/ptrace.c b/arch/i386/kernel/ptrace.c index b2f17640ceff..5606ec7a5c2b 100644 --- a/arch/i386/kernel/ptrace.c +++ b/arch/i386/kernel/ptrace.c | |||
@@ -682,24 +682,18 @@ void do_syscall_trace(struct pt_regs *regs, int entryexit) | |||
682 | /* do the secure computing check first */ | 682 | /* do the secure computing check first */ |
683 | secure_computing(regs->orig_eax); | 683 | secure_computing(regs->orig_eax); |
684 | 684 | ||
685 | if (unlikely(current->audit_context)) { | 685 | if (unlikely(current->audit_context) && entryexit) |
686 | if (!entryexit) | 686 | audit_syscall_exit(current, AUDITSC_RESULT(regs->eax), regs->eax); |
687 | audit_syscall_entry(current, regs->orig_eax, | ||
688 | regs->ebx, regs->ecx, | ||
689 | regs->edx, regs->esi); | ||
690 | else | ||
691 | audit_syscall_exit(current, regs->eax); | ||
692 | } | ||
693 | 687 | ||
694 | if (!(current->ptrace & PT_PTRACED)) | 688 | if (!(current->ptrace & PT_PTRACED)) |
695 | return; | 689 | goto out; |
696 | 690 | ||
697 | /* Fake a debug trap */ | 691 | /* Fake a debug trap */ |
698 | if (test_thread_flag(TIF_SINGLESTEP)) | 692 | if (test_thread_flag(TIF_SINGLESTEP)) |
699 | send_sigtrap(current, regs, 0); | 693 | send_sigtrap(current, regs, 0); |
700 | 694 | ||
701 | if (!test_thread_flag(TIF_SYSCALL_TRACE)) | 695 | if (!test_thread_flag(TIF_SYSCALL_TRACE)) |
702 | return; | 696 | goto out; |
703 | 697 | ||
704 | /* the 0x80 provides a way for the tracing parent to distinguish | 698 | /* the 0x80 provides a way for the tracing parent to distinguish |
705 | between a syscall stop and SIGTRAP delivery */ | 699 | between a syscall stop and SIGTRAP delivery */ |
@@ -714,4 +708,9 @@ void do_syscall_trace(struct pt_regs *regs, int entryexit) | |||
714 | send_sig(current->exit_code, current, 1); | 708 | send_sig(current->exit_code, current, 1); |
715 | current->exit_code = 0; | 709 | current->exit_code = 0; |
716 | } | 710 | } |
711 | out: | ||
712 | if (unlikely(current->audit_context) && !entryexit) | ||
713 | audit_syscall_entry(current, AUDIT_ARCH_I386, regs->orig_eax, | ||
714 | regs->ebx, regs->ecx, regs->edx, regs->esi); | ||
715 | |||
717 | } | 716 | } |