Commit 49ba178c authored by Ingo Molnar's avatar Ingo Molnar Committed by Linus Torvalds

[PATCH] Re: pinpointed: PANIC caused by dequeue_signal() in current Linus

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.
parent 86ee4c5d
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
static struct fs_struct init_fs = INIT_FS; static struct fs_struct init_fs = INIT_FS;
static struct files_struct init_files = INIT_FILES; 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); struct mm_struct init_mm = INIT_MM(init_mm);
/* /*
......
...@@ -514,6 +514,8 @@ static inline int make_private_signals(void) ...@@ -514,6 +514,8 @@ static inline int make_private_signals(void)
spin_lock_init(&newsig->siglock); spin_lock_init(&newsig->siglock);
atomic_set(&newsig->count, 1); atomic_set(&newsig->count, 1);
memcpy(newsig->action, current->sig->action, sizeof(newsig->action)); memcpy(newsig->action, current->sig->action, sizeof(newsig->action));
init_sigpending(&newsig->shared_pending);
spin_lock_irq(&current->sigmask_lock); spin_lock_irq(&current->sigmask_lock);
current->sig = newsig; current->sig = newsig;
spin_unlock_irq(&current->sigmask_lock); spin_unlock_irq(&current->sigmask_lock);
......
...@@ -29,10 +29,11 @@ ...@@ -29,10 +29,11 @@
.mmlist = LIST_HEAD_INIT(name.mmlist), \ .mmlist = LIST_HEAD_INIT(name.mmlist), \
} }
#define INIT_SIGNALS { \ #define INIT_SIGNALS(sig) { \
.count = ATOMIC_INIT(1), \ .count = ATOMIC_INIT(1), \
.action = { {{0,}}, }, \ .action = { {{0,}}, }, \
.siglock = SPIN_LOCK_UNLOCKED \ .siglock = SPIN_LOCK_UNLOCKED, \
.shared_pending = { NULL, &sig.shared_pending.head, {{0}}}, \
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment