network - Fix race in accept() - try #2
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 17 Sep 2010 08:45:04 +0000 (01:45 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 17 Sep 2010 08:45:04 +0000 (01:45 -0700)
commit5217bcbc2e93291d234b66b766c4801140f9d4f1
treefc45b03c4b4cbc4d15406db3282fea7dceb3a2a2
parent177e553af09a98309d1c3b722e7f9cf595517be3
network - Fix race in accept() - try #2

* The last fix wasn't good enough.  Really try to fix it this time.  Use
  a pool token and validate so_head after acquiring it to deal with races,
  interlock against 0-ref races (sockets can be on the so_comp/so_incomp
  queues with 0 references), and use it for the accept predicate.
sys/kern/uipc_socket.c
sys/kern/uipc_socket2.c
sys/kern/uipc_syscalls.c
sys/netgraph/ksocket/ng_ksocket.c