Skip to content

Commit

Permalink
[PATCH] pi-futex: missing pi_waiters plist initialization
Browse files Browse the repository at this point in the history
Initialize init task's pi_waiters plist.  Otherwise cpu hotplug of cpu 0
might crash, since rt_mutex_getprio() accesses an uninitialized list head.

call chain which led to crash:

take_cpu_down
sched_idle_next
__setscheduler
rt_mutex_getprio

Using PLIST_HEAD_INIT in the INIT_TASK macro doesn't work unfortunately,
since the pi_waiters member is only conditionally present.

Cc: Arjan van de Ven <arjan@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Heiko Carstens authored and Linus Torvalds committed Jul 31, 2006
1 parent a04b61d commit b50f60c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -6766,6 +6766,11 @@ void __init sched_init(void)
}

set_load_weight(&init_task);

#ifdef CONFIG_RT_MUTEXES
plist_head_init(&init_task.pi_waiters, &init_task.pi_lock);
#endif

/*
* The boot idle thread does lazy MMU switching as well:
*/
Expand Down

0 comments on commit b50f60c

Please sign in to comment.