race condition in knote deletion?

Samuel J. Greear sjg at evilcode.net
Tue Feb 1 19:41:32 PST 2011


On Tue, Feb 1, 2011 at 6:26 PM, Matthew Dillon
<dillon at apollo.backplane.com> wrote:
> :        kn->kn_status |= KN_DELETING | KN_REPROCESS;
> :
> :So  wouldn't another cpu running knote_release() while the 1st one
> :sleeps call knote_detach_and_drop() too
> :causing a crash when the 1st cpu resumes?
>
>    Only the thread which set KN_PROCESSING can release the knote,
>    so it shouldn't be possible.  Other threads will see that KN_PROCESSING
>    is already set and not try to do anything drastic to the knote.
>
>                                        -Matt
>                                        Matthew Dillon
>                                        <dillon at backplane.com>
>

I think the mouse detach bug is probably something more fundamental,
like teardown ordering. It's very easy to tickle, start up X with a
usb mouse configured (/dev/ums*), unplug the mouse. It may take a bit
of time before it occurs, but switching from X to a console seems to
make it happen immediately.

Sam






More information about the Kernel mailing list