diff options
author | Oleg Nesterov <[email protected]> | 2010-05-26 14:44:08 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2010-05-27 09:12:51 -0700 |
commit | fa2755e20ab0c7215d99c2dc7c262e98a09b01df (patch) | |
tree | 6e28b6ea4984bc22e1a2d16afd71d0e6e65da90c | |
parent | 72680a191b934377430032f93af15ef50aafb3a8 (diff) |
INIT_TASK() should initialize ->thread_group list
The trivial /sbin/init doing
int main(void)
{
kill(0, SIGKILL)
}
crashes the kernel.
This happens because __kill_pgrp_info(init_struct_pid) also sends SIGKILL
to the swapper process which runs with the uninitialized ->thread_group.
Change INIT_TASK() to initialize ->thread_group properly.
Note: the real problem is that the swapper process must not be visible to
signals, see the next patch. But this change is right anyway and fixes
the crash.
Reported-and-tested-by: Mathias Krause <[email protected]>
Signed-off-by: Oleg Nesterov <[email protected]>
Cc: Cedric Le Goater <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: Eric Biederman <[email protected]>
Cc: Herbert Poetzl <[email protected]>
Cc: Mathias Krause <[email protected]>
Acked-by: Roland McGrath <[email protected]>
Acked-by: Serge Hallyn <[email protected]>
Acked-by: Sukadev Bhattiprolu <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r-- | include/linux/init_task.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 0551e0dcb71b..6deb1ba52fdb 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h @@ -163,6 +163,7 @@ extern struct cred init_cred; [PIDTYPE_PGID] = INIT_PID_LINK(PIDTYPE_PGID), \ [PIDTYPE_SID] = INIT_PID_LINK(PIDTYPE_SID), \ }, \ + .thread_group = LIST_HEAD_INIT(tsk.thread_group), \ .dirties = INIT_PROP_LOCAL_SINGLE(dirties), \ INIT_IDS \ INIT_PERF_EVENTS(tsk) \ |