kernel - close numerous kqueue MP and blocking races
authorMatthew Dillon <dillon@apollo.backplane.com>
Sun, 22 Aug 2010 01:41:15 +0000 (18:41 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sun, 22 Aug 2010 01:41:15 +0000 (18:41 -0700)
commitcf9f4e88a67efbe26053ec74dc81d4f8e6c5bafc
treec3572db3f4c726d5620503e5a7979c35ebd78add
parent96f9dac19ca33eab88e62ea5758a611718174a27
kernel - close numerous kqueue MP and blocking races

* create race

Close a race where one thread registers a kevent and blocks in
f_attach allowing another thread to register a change or deletion
on the same event.

* delete race

Close a race where one thread deletes a kevent and blocks in
f_detach allowing another thread to register a change or deletion
on the same event.

* scan/close race

Close a race where one thread is in the middle of a kqueue_scan()
and another concurrently close()s a related file descriptor.  This
could cause select and poll to loop forever due to not being able
to delete the 'spurious' kevent.

* register/close race

Close a race where one thread registers a kevent and blocks
in f_attach and another thread close()s the related file
descriptor at the same time.
sys/kern/kern_descrip.c
sys/kern/kern_event.c
sys/sys/event.h
sys/sys/file.h