Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.4.36 /kernel/signal.c

Filename:/kernel/signal.c
Lines Added:13
Lines Deleted:2
Also changed in: (Previous) 2.4.36-rc1  2.4.35.5  2.4.25  2.4.25-rc4  2.4.25-rc3  2.4.25-rc2 
(Following)

Location
[  2.4.36
  [  kernel
     o  signal.c

Patch

diff --git a/kernel/signal.c b/kernel/signal.c
index 77371a0..dff04d7 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -409,8 +409,19 @@ static int ignored_signal(int sig, struct task_struct *t)
 static void handle_stop_signal(int sig, struct task_struct *t)
 {
    switch (sig) {
-   case SIGKILL: case SIGCONT:
-      /* Wake up the process if stopped.  */
+   case SIGCONT:
+      /* SIGCONT must not wake a task while it's being traced */
+      if ((t->state == TASK_STOPPED) &&
+          ((t->ptrace & (PT_PTRACED|PT_TRACESYS)) ==
+           (PT_PTRACED|PT_TRACESYS)))
+         return;
+      /* fall through */
+   case SIGKILL:
+      /* Wake up the process if stopped.
+       * Note that if the process is being traced, waking it up
+       * will make it continue before being killed. This may end
+       * up unexpectedly completing whatever syscall is pending.
+       */
       if (t->state == TASK_STOPPED)
          wake_up_process(t);
       t->exit_code = 0;


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.