DragonFly BSD
DragonFly commits List (threaded) for 2010-09
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

git: network - MP socket free & abort interactions, so_state


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 10 Sep 2010 09:09:29 -0700 (PDT)

commit 6cef7136f04e2b24a6db289e78720d6d8c60274e
Author: Matthew Dillon <dillon@apollo.backplane.com>
Date:   Thu Sep 9 21:01:20 2010 -0700

    network - MP socket free & abort interactions, so_state
    
    * Add so_refs and ref-count the socket structure to deal with
      MP races on sofree().
    
    * Ref the socket structure for all soabort() operations (they are usually
      asynchronous).  The netmsg_pru_abort() handler will sofree() the ref
      after calling the protocol stack's abort function.
    
    * Use atomic ops to set and clear bits in so_state, because it is modified
      by both the fronttend and the backend.
    
    * Remove numerous critical sections that are no longer effective.
    
    * Protect the accept queues with so_rcv.ssb_token.
    
    * Protect after-the-fact calls to soisdisconnected() with a soreference()
      to avoid use-after-free cases.
    
    * Wrap unix domain, mroute, div, raw, and key sockets/protocols with their
      own private tokens.

Summary of changes:
 sys/ddb/db_output.c                                |    2 +
 sys/kern/sys_generic.c                             |    5 +
 sys/kern/sys_socket.c                              |    5 +-
 sys/kern/uipc_mbuf.c                               |    2 +-
 sys/kern/uipc_msg.c                                |   16 +-
 sys/kern/uipc_socket.c                             |  133 +++----
 sys/kern/uipc_socket2.c                            |   73 +++--
 sys/kern/uipc_syscalls.c                           |   11 +-
 sys/kern/uipc_usrreq.c                             |  406 +++++++++++++++-----
 sys/net/ip_mroute/ip_mroute.c                      |  153 ++++----
 sys/net/raw_cb.c                                   |    5 +-
 sys/net/raw_usrreq.c                               |   10 +-
 sys/net/rtsock.c                                   |    3 +
 sys/netbt/hci_socket.c                             |   15 +-
 sys/netbt/l2cap_socket.c                           |    8 +-
 sys/netbt/rfcomm_socket.c                          |    8 +-
 sys/netbt/sco_socket.c                             |    8 +-
 sys/netgraph/ksocket/ng_ksocket.c                  |   22 +-
 sys/netgraph/socket/ng_socket.c                    |    7 +-
 .../bluetooth/socket/ng_btsocket_rfcomm.c          |   10 +-
 sys/netgraph7/ng_ksocket.c                         |    8 +-
 sys/netgraph7/ng_socket.c                          |    8 +-
 sys/netinet/in_pcb.c                               |    5 +-
 sys/netinet/ip_divert.c                            |   38 ++-
 sys/netinet/raw_ip.c                               |   60 +++-
 sys/netinet/sctp_indata.c                          |   12 +
 sys/netinet/sctp_input.c                           |    2 +-
 sys/netinet/sctp_pcb.c                             |   31 +--
 sys/netinet/sctp_peeloff.c                         |    4 +-
 sys/netinet/sctp_usrreq.c                          |   21 +-
 sys/netinet/sctputil.c                             |   27 ++
 sys/netinet/tcp_input.c                            |   25 +-
 sys/netinet/tcp_subr.c                             |    1 +
 sys/netinet/tcp_usrreq.c                           |   60 ++--
 sys/netinet/udp_usrreq.c                           |   40 +-
 sys/netinet6/in6_pcb.c                             |    2 +-
 sys/netinet6/ipsec.c                               |   12 +
 sys/netinet6/raw_ip6.c                             |   19 +-
 sys/netinet6/sctp6_usrreq.c                        |   22 +-
 sys/netinet6/udp6_usrreq.c                         |   25 +-
 sys/netproto/atalk/ddp_usrreq.c                    |   45 +--
 sys/netproto/atm/atm_aal5.c                        |    3 +-
 sys/netproto/atm/atm_socket.c                      |    2 +-
 sys/netproto/ipsec/keysock.c                       |    4 +-
 sys/netproto/ipx/ipx_pcb.c                         |    3 +-
 sys/netproto/ipx/ipx_usrreq.c                      |   27 +-
 sys/netproto/ipx/spx_usrreq.c                      |   11 +-
 sys/netproto/key/key.c                             |  144 ++++---
 sys/netproto/key/key.h                             |    1 +
 sys/netproto/key/keydb.c                           |    9 +-
 sys/netproto/key/keysock.c                         |   61 ++--
 sys/netproto/natm/natm.c                           |   18 +-
 sys/netproto/ncp/ncp_sock.c                        |    2 +-
 sys/netproto/ns/idp_usrreq.c                       |   13 +-
 sys/netproto/ns/ns_pcb.c                           |    2 +-
 sys/netproto/ns/spp_usrreq.c                       |   11 +-
 sys/netproto/smb/smb_trantcp.c                     |    2 +-
 sys/sys/socketvar.h                                |   13 +-
 sys/sys/socketvar2.h                               |   26 ++-
 sys/vfs/fifofs/fifo_vnops.c                        |    3 +-
 sys/vfs/nfs/nfs_socket.c                           |    3 +-
 61 files changed, 1107 insertions(+), 620 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/6cef7136f04e2b24a6db289e78720d6d8c60274e


-- 
DragonFly BSD source repository



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]