git: network - Fix race in accept() - try #2

Matthew Dillon dillon at crater.dragonflybsd.org
Fri Sep 17 01:47:54 PDT 2010


commit 5217bcbc2e93291d234b66b766c4801140f9d4f1
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Fri Sep 17 01:45:04 2010 -0700

    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.

Summary of changes:
 sys/kern/uipc_socket.c            |   32 ++++++++++++++++++++++++--------
 sys/kern/uipc_socket2.c           |   26 +++++++++++++++++++-------
 sys/kern/uipc_syscalls.c          |   10 +++++++---
 sys/netgraph/ksocket/ng_ksocket.c |    6 +++---
 4 files changed, 53 insertions(+), 21 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/5217bcbc2e93291d234b66b766c4801140f9d4f1


-- 
DragonFly BSD source repository





More information about the Commits mailing list