diff options
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/ptrace.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c index 77b60085a810..2779321046bd 100644 --- a/arch/x86/kernel/ptrace.c +++ b/arch/x86/kernel/ptrace.c | |||
@@ -1767,29 +1767,22 @@ asmregparm long syscall_trace_enter(struct pt_regs *regs) | |||
1767 | 1767 | ||
1768 | asmregparm void syscall_trace_leave(struct pt_regs *regs) | 1768 | asmregparm void syscall_trace_leave(struct pt_regs *regs) |
1769 | { | 1769 | { |
1770 | bool step; | ||
1771 | |||
1770 | if (unlikely(current->audit_context)) | 1772 | if (unlikely(current->audit_context)) |
1771 | audit_syscall_exit(AUDITSC_RESULT(regs->ax), regs->ax); | 1773 | audit_syscall_exit(AUDITSC_RESULT(regs->ax), regs->ax); |
1772 | 1774 | ||
1773 | if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) | 1775 | if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) |
1774 | trace_sys_exit(regs, regs->ax); | 1776 | trace_sys_exit(regs, regs->ax); |
1775 | 1777 | ||
1776 | if (test_thread_flag(TIF_SYSCALL_TRACE)) | ||
1777 | tracehook_report_syscall_exit(regs, 0); | ||
1778 | |||
1779 | /* | 1778 | /* |
1780 | * If TIF_SYSCALL_EMU is set, we only get here because of | 1779 | * If TIF_SYSCALL_EMU is set, we only get here because of |
1781 | * TIF_SINGLESTEP (i.e. this is PTRACE_SYSEMU_SINGLESTEP). | 1780 | * TIF_SINGLESTEP (i.e. this is PTRACE_SYSEMU_SINGLESTEP). |
1782 | * We already reported this syscall instruction in | 1781 | * We already reported this syscall instruction in |
1783 | * syscall_trace_enter(), so don't do any more now. | 1782 | * syscall_trace_enter(). |
1784 | */ | ||
1785 | if (unlikely(test_thread_flag(TIF_SYSCALL_EMU))) | ||
1786 | return; | ||
1787 | |||
1788 | /* | ||
1789 | * If we are single-stepping, synthesize a trap to follow the | ||
1790 | * system call instruction. | ||
1791 | */ | 1783 | */ |
1792 | if (test_thread_flag(TIF_SINGLESTEP) && | 1784 | step = unlikely(test_thread_flag(TIF_SINGLESTEP)) && |
1793 | tracehook_consider_fatal_signal(current, SIGTRAP)) | 1785 | !test_thread_flag(TIF_SYSCALL_EMU); |
1794 | send_sigtrap(current, regs, 0, TRAP_BRKPT); | 1786 | if (step || test_thread_flag(TIF_SYSCALL_TRACE)) |
1787 | tracehook_report_syscall_exit(regs, step); | ||
1795 | } | 1788 | } |