aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2010-05-26 17:44:08 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-27 12:12:51 -0400
commitfa2755e20ab0c7215d99c2dc7c262e98a09b01df (patch)
tree6e28b6ea4984bc22e1a2d16afd71d0e6e65da90c /include
parent72680a191b934377430032f93af15ef50aafb3a8 (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 <mathias.krause@secunet.com> Signed-off-by: Oleg Nesterov <oleg@redhat.com> Cc: Cedric Le Goater <clg@fr.ibm.com> Cc: Dave Hansen <haveblue@us.ibm.com> Cc: Eric Biederman <ebiederm@xmission.com> Cc: Herbert Poetzl <herbert@13thfloor.at> Cc: Mathias Krause <Mathias.Krause@secunet.com> Acked-by: Roland McGrath <roland@redhat.com> Acked-by: Serge Hallyn <serue@us.ibm.com> Acked-by: Sukadev Bhattiprolu <sukadev@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/init_task.h1
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;
163 [PIDTYPE_PGID] = INIT_PID_LINK(PIDTYPE_PGID), \ 163 [PIDTYPE_PGID] = INIT_PID_LINK(PIDTYPE_PGID), \
164 [PIDTYPE_SID] = INIT_PID_LINK(PIDTYPE_SID), \ 164 [PIDTYPE_SID] = INIT_PID_LINK(PIDTYPE_SID), \
165 }, \ 165 }, \
166 .thread_group = LIST_HEAD_INIT(tsk.thread_group), \
166 .dirties = INIT_PROP_LOCAL_SINGLE(dirties), \ 167 .dirties = INIT_PROP_LOCAL_SINGLE(dirties), \
167 INIT_IDS \ 168 INIT_IDS \
168 INIT_PERF_EVENTS(tsk) \ 169 INIT_PERF_EVENTS(tsk) \