2002-03-05 18:55:13

by Chris Mason

[permalink] [raw]
Subject: [PATCH] proc race on task_struct->sig


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)