kernel - Use pool tokens to protect unix domain PCBs
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 14 Sep 2012 16:10:06 +0000 (09:10 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 14 Sep 2012 16:10:06 +0000 (09:10 -0700)
commit524d0e3c7c3041d91aaa8a6f0d1efa4623c0f413
tree322e60e67844238d5460e1f8d10cb811187e92e3
parent857e4745c6998c63fa433cf7e0d0e7da6d0d18a7
kernel - Use pool tokens to protect unix domain PCBs

* The read, status, and write paths now use per-pcb pool tokens
  instead of the global unp_token.  The global token is still used
  for accept, connect, disconnect, etc.

* General semantics for making this SMP safe is to obtain a pointer
  to the unp from so->so_pcb, then obtain the related pool token,
  then re-check that so->so_pcb still equals unp.

* Pool token protects the peer pointer, unp->unp_conn.  Any change
  to unp->unp_conn requires both the pool token and the global token.

* This should improve concurrent reading and writing w/unix domain
  sockets.
sys/kern/uipc_usrreq.c