Skip to contentSkip to conversation

ptrace_signal: check PT_PTRACED before reporting a signal

PATCH In review Oleg Nesterov 1 participant 1 message Dec 18, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 3/7 ptrace_signal: check PT_PTRACED before reporting a signal

No functional changes, preparation for utrace-ptrace.

Change ptrace_signal() to check PT_PTRACED instead of task_ptrace() != 0. Currently this is the same, PT_PTRACED must be always set if the task is ptraced.

This change is needed to make sure ptrace_signal() does nothing if ptrace is implemented on top of utrace, eventually this code will be removed completely.

---

 kernel/signal.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/signal.c renamed from kernel/signal.c~3_PTRACE_SIGNAL_CK_PTRACED +1 -1
@@ -1764,7 +1764,7 @@ static int do_signal_stop(int signr)
 static int ptrace_signal(int signr, siginfo_t *info,
 			 struct pt_regs *regs, void *cookie)
 {
-	if (!task_ptrace(current))
+	if (!(task_ptrace(current) & PT_PTRACED))
 		return signr;
 
 	ptrace_signal_deliver(regs, cookie);