]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Re: pinpointed: PANIC caused by dequeue_signal() in current Linus
authorIngo Molnar <mingo@elte.hu>
Sun, 8 Sep 2002 13:04:56 +0000 (06:04 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Sun, 8 Sep 2002 13:04:56 +0000 (06:04 -0700)
This fixes the bootup crash.  There were two initialization bugs:

- INIT_SIGNAL needs to set shared_pending.

- exec() needs to set up newsig properly.

the second one caused the crash Anton saw.

arch/i386/kernel/init_task.c
fs/exec.c
include/linux/init_task.h

index f652f279b787c4d97ef359e4c7a896ea484543ed..4eb40a9582c7028bd012286d1d80e1e811589277 100644 (file)
@@ -10,7 +10,7 @@
 
 static struct fs_struct init_fs = INIT_FS;
 static struct files_struct init_files = INIT_FILES;
-static struct signal_struct init_signals = INIT_SIGNALS;
+static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 struct mm_struct init_mm = INIT_MM(init_mm);
 
 /*
index 9c00b733fceefb91b4baf3db220513a1a2f5fb53..9344e1ec3894ccba385424eeabc410b79565e6f7 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -514,6 +514,8 @@ static inline int make_private_signals(void)
        spin_lock_init(&newsig->siglock);
        atomic_set(&newsig->count, 1);
        memcpy(newsig->action, current->sig->action, sizeof(newsig->action));
+       init_sigpending(&newsig->shared_pending);
+
        spin_lock_irq(&current->sigmask_lock);
        current->sig = newsig;
        spin_unlock_irq(&current->sigmask_lock);
index 80a57914bccc049453f35bf3562ce5225bd74b24..bdf03241a0090f268d778465a74a331db9b0f65a 100644 (file)
        .mmlist         = LIST_HEAD_INIT(name.mmlist),  \
 }
 
-#define INIT_SIGNALS { \
+#define INIT_SIGNALS(sig) {    \
        .count          = ATOMIC_INIT(1),               \
        .action         = { {{0,}}, },                  \
-       .siglock        = SPIN_LOCK_UNLOCKED            \
+       .siglock        = SPIN_LOCK_UNLOCKED,           \
+       .shared_pending = { NULL, &sig.shared_pending.head, {{0}}}, \
 }
 
 /*