rc3-mm1: oops in keventd_stop_kthread
A message that is not in the archive (sent off-list or not yet received): [email protected]
In message <[email protected]> you write:
Quoted 6 lines · Rusty Russell
Quoted 3 lines
Um, why is ALSA using kthread?
Is there a modprobe -r in your script somewhere?
yes. not sure why it is called though.
Reproduced using your config, and fixed. Classic use-after-free bug:
another victory for DEBUG_PAGEALLOC.
Thanks Andrey!
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
Name: Kthread waitpid Race II
Author: Rusty Russell
Status: Tested on 2.6.2-rc3
Depends: Hotcpu/kthread-wait-race.patch.gz
We can't compare waitpid() result with stop->k->tgid, since the thread will be gone by then (thanks to Andrey Borzenkov and CONFIG_DEBUG_PAGEALLOC!
kernel/kthread.c +5 -2
@@ -107,7 +112,7 @@ static void adopt_kthread(struct task_ststatic void keventd_stop_kthread (void *_stop) {struct kthread_stop_info *stop = _stop; -int status; +int status, pid;sigset_t blocked;struct k_sigaction sa;
@@ -119,11 +124,14 @@ static void keventd_stop_kthread(void *_allow_signal (SIGCHLD );adopt_kthread (stop->k); +/* Grab pid now: after waitpid(), stop->k is invalid. */ + pid = stop->k->tgid; +/* All signals are blocked, hence the force. */ force_sig (SIGTERM , stop->k);/* Other threads might exit: if we ask for one pid that * returns -ERESTARTSYS. */ -while (waitpid (-1 , &status, __WALL) != stop->k->tgid) +while (waitpid (-1 , &status, __WALL) != pid)flush_signals (current); stop->result = -((status >>8 ) &0xFF );complete (&stop->done);
Quoted 1 line · Rusty Russell
Reproduced using your config, and fixed.
confirmed with 2.6.2-mm1
thank you