[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
kern/38812: race between lwp_exit_switchaway and exit1/coredump
>Synopsis: race between lwp_exit_switchaway and exit1/coredump
>Arrival-Date: Sat May 31 18:35:00 +0000 2008
>Originator: Andrew Doran
The NetBSD Project
lwp_exit_switchaway does (l->l_flag &= ~LW_RUNNING) without holding
the LWP locked.
exit1/coredump may set other flags on l_flag, like LW_EXIT. There is
a tiny window where this update may obliterate the previous clearing
of LW_RUNNING by lwp_exit_switchaway.
Result: exit1/coredump later spin in lwp_free, waiting for the zombie
LWP to come off the CPU. Because LW_RUNNING is set it appears that it
is still on the CPU.
Move the RUNNING flag into the thread-private flag word, l_pflag.
Testing this without a lock is OK at all the points we care about
the RUNNING flag in particular.
Main Index |
Thread Index |