All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC,PATCH 09/14] tracehooks: check PT_PTRACED before reporting the single-step
@ 2009-11-24 20:02 Oleg Nesterov
  0 siblings, 0 replies; only message in thread
From: Oleg Nesterov @ 2009-11-24 20:02 UTC (permalink / raw)
  To: Alexey Dobriyan, Ananth Mavinakayanahalli, Christoph Hellwig,
	Frank Ch. Eigler, Ingo Molnar, Peter Zijlstra, Roland McGrath
  Cc: linux-kernel, utrace-devel

No functional changes, preparation for utrace-ptrace.

tracehook_report_syscall_exit() and tracehook_signal_handler() assume
that only ptrace can set TIF_SINGLESTEP. Currently this is true but we
are going to change this, the stepping logic will be moved into utrace
layer.

Change this code to check PT_PTRACED, ptrace-utrace doesn't set it.

Signed-off-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
---

 include/linux/tracehook.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- V1/include/linux/tracehook.h~9_SIGNAL_HANDLER_CK_PTRACE	2009-11-24 20:29:07.000000000 +0100
+++ V1/include/linux/tracehook.h	2009-11-24 20:30:15.000000000 +0100
@@ -134,7 +134,7 @@ static inline __must_check int tracehook
  */
 static inline void tracehook_report_syscall_exit(struct pt_regs *regs, int step)
 {
-	if (step) {
+	if (step && (task_ptrace(current) & PT_PTRACED)) {
 		siginfo_t info;
 		user_single_step_siginfo(current, regs, &info);
 		force_sig_info(SIGTRAP, &info, current);
@@ -386,7 +386,7 @@ static inline void tracehook_signal_hand
 					    const struct k_sigaction *ka,
 					    struct pt_regs *regs, int stepping)
 {
-	if (stepping)
+	if (stepping && (task_ptrace(current) & PT_PTRACED))
 		ptrace_notify(SIGTRAP);
 }
 


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-11-24 20:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-24 20:02 [RFC,PATCH 09/14] tracehooks: check PT_PTRACED before reporting the single-step Oleg Nesterov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.