No functional changes, preparation for utrace-ptrace.

tracehook_signal_handler() is the only caller of ptrace_notify() which
doesn't check the task is ptraced, it assumes that only ptrace can set
TIF_SINGLESTEP.

Currently this is true but we are going to change this, check PT_PTRACED.

Signed-off-by: Oleg Nesterov <o...@redhat.com>
---

 include/linux/tracehook.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- PU/include/linux/tracehook.h~117_SIGNAL_HANDLER_CK_PTRACE   2009-10-26 
00:06:21.000000000 +0100
+++ PU/include/linux/tracehook.h        2009-10-26 00:10:49.000000000 +0100
@@ -401,7 +401,7 @@ static inline void tracehook_signal_hand
 {
        if (task_utrace_flags(current))
                utrace_signal_handler(current, stepping);
-       if (stepping)
+       if (stepping && (task_ptrace(current) & PT_PTRACED))
                ptrace_notify(SIGTRAP);
 }
 

Reply via email to