diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2012-07-17 13:43:58 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2013-10-29 16:25:04 -0400 |
commit | bc3d22c13e8b1ae0be016c67406787231f9e6548 (patch) | |
tree | f22fd98e391c74ea484c33b247c3869df5a95762 /arch/mips/kernel | |
parent | 46e12c07b3b9603c60fc1d421ff18618241cb081 (diff) |
MIPS: ptrace: Use tracehook helpers.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r-- | arch/mips/kernel/ptrace.c | 46 |
1 files changed, 5 insertions, 41 deletions
diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c index 8ae1ebef8b71..7a5d7ac6b0d4 100644 --- a/arch/mips/kernel/ptrace.c +++ b/arch/mips/kernel/ptrace.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/smp.h> | 24 | #include <linux/smp.h> |
25 | #include <linux/user.h> | 25 | #include <linux/user.h> |
26 | #include <linux/security.h> | 26 | #include <linux/security.h> |
27 | #include <linux/tracehook.h> | ||
27 | #include <linux/audit.h> | 28 | #include <linux/audit.h> |
28 | #include <linux/seccomp.h> | 29 | #include <linux/seccomp.h> |
29 | 30 | ||
@@ -540,28 +541,9 @@ asmlinkage void syscall_trace_enter(struct pt_regs *regs) | |||
540 | /* do the secure computing check first */ | 541 | /* do the secure computing check first */ |
541 | secure_computing_strict(regs->regs[2]); | 542 | secure_computing_strict(regs->regs[2]); |
542 | 543 | ||
543 | if (!(current->ptrace & PT_PTRACED)) | 544 | if (test_thread_flag(TIF_SYSCALL_TRACE)) |
544 | goto out; | 545 | ptrace_report_syscall(regs); |
545 | 546 | ||
546 | if (!test_thread_flag(TIF_SYSCALL_TRACE)) | ||
547 | goto out; | ||
548 | |||
549 | /* The 0x80 provides a way for the tracing parent to distinguish | ||
550 | between a syscall stop and SIGTRAP delivery */ | ||
551 | ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) ? | ||
552 | 0x80 : 0)); | ||
553 | |||
554 | /* | ||
555 | * this isn't the same as continuing with a signal, but it will do | ||
556 | * for normal use. strace only continues with a signal if the | ||
557 | * stopping signal is not SIGTRAP. -brl | ||
558 | */ | ||
559 | if (current->exit_code) { | ||
560 | send_sig(current->exit_code, current, 1); | ||
561 | current->exit_code = 0; | ||
562 | } | ||
563 | |||
564 | out: | ||
565 | audit_syscall_entry(audit_arch(), regs->regs[2], | 547 | audit_syscall_entry(audit_arch(), regs->regs[2], |
566 | regs->regs[4], regs->regs[5], | 548 | regs->regs[4], regs->regs[5], |
567 | regs->regs[6], regs->regs[7]); | 549 | regs->regs[6], regs->regs[7]); |
@@ -582,26 +564,8 @@ asmlinkage void syscall_trace_leave(struct pt_regs *regs) | |||
582 | 564 | ||
583 | audit_syscall_exit(regs); | 565 | audit_syscall_exit(regs); |
584 | 566 | ||
585 | if (!(current->ptrace & PT_PTRACED)) | 567 | if (test_thread_flag(TIF_SYSCALL_TRACE)) |
586 | return; | 568 | tracehook_report_syscall_exit(regs, 0); |
587 | |||
588 | if (!test_thread_flag(TIF_SYSCALL_TRACE)) | ||
589 | return; | ||
590 | |||
591 | /* The 0x80 provides a way for the tracing parent to distinguish | ||
592 | between a syscall stop and SIGTRAP delivery */ | ||
593 | ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) ? | ||
594 | 0x80 : 0)); | ||
595 | |||
596 | /* | ||
597 | * this isn't the same as continuing with a signal, but it will do | ||
598 | * for normal use. strace only continues with a signal if the | ||
599 | * stopping signal is not SIGTRAP. -brl | ||
600 | */ | ||
601 | if (current->exit_code) { | ||
602 | send_sig(current->exit_code, current, 1); | ||
603 | current->exit_code = 0; | ||
604 | } | ||
605 | 569 | ||
606 | user_enter(); | 570 | user_enter(); |
607 | } | 571 | } |