[PATCH] proc race on task_struct->sig

From: Chris Mason (mason@suse.com)
Date: Tue Mar 05 2002 - 13:54:20 EST


Hello everyone,

I think collect_sigign_sigcatch can race against exit_sighand.
I haven't been able to reproduce it, but I think it causes
the oops reported in the 'Kernel Hangs 2.4.16 on heavy io Oracle
Tivolie TSM' thread.

This patch should fix it:

-chris

--- test.1/fs/proc/array.c Wed, 27 Feb 2002 11:54:30 -0500
+++ test.1(w)/fs/proc/array.c Tue, 05 Mar 2002 11:16:44 -0500
@@ -226,6 +226,7 @@
         sigemptyset(ign);
         sigemptyset(catch);
 
+ spin_lock_irq(&p->sigmask_lock);
         if (p->sig) {
                 k = p->sig->action;
                 for (i = 1; i <= _NSIG; ++i, ++k) {
@@ -235,6 +236,7 @@
                                 sigaddset(catch, i);
                 }
         }
+ spin_unlock_irq(&p->sigmask_lock);
 }
 
 static inline char * task_sig(struct task_struct *p, char *buffer)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Mar 07 2002 - 21:00:45 EST