Commit fa2755e2 authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Linus Torvalds
Browse files

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: default avatarMathias Krause <>
Signed-off-by: default avatarOleg Nesterov <>
Cc: Cedric Le Goater <>
Cc: Dave Hansen <>
Cc: Eric Biederman <>
Cc: Herbert Poetzl <>
Cc: Mathias Krause <>
Acked-by: default avatarRoland McGrath <>
Acked-by: default avatarSerge Hallyn <>
Acked-by: default avatarSukadev Bhattiprolu <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 72680a19
......@@ -163,6 +163,7 @@ extern struct cred init_cred;
}, \
.thread_group = LIST_HEAD_INIT(tsk.thread_group), \
.dirties = INIT_PROP_LOCAL_SINGLE(dirties), \
Supports Markdown
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