From owner-cvs-all@FreeBSD.ORG Sat Jun 12 20:47:50 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5181D16A4CE; Sat, 12 Jun 2004 20:47:50 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 337BA43D55; Sat, 12 Jun 2004 20:47:50 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i5CKlW1S099014; Sat, 12 Jun 2004 20:47:32 GMT (envelope-from rwatson@repoman.freebsd.org) Received: (from rwatson@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i5CKlWin099013; Sat, 12 Jun 2004 20:47:32 GMT (envelope-from rwatson) Message-Id: <200406122047.i5CKlWin099013@repoman.freebsd.org> From: Robert Watson Date: Sat, 12 Jun 2004 20:47:32 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/kern kern_descrip.c uipc_socket.c uipc_syscalls.c uipc_usrreq.c src/sys/net raw_cb.c raw_usrreq.c src/sys/netatm atm_socket.c src/sys/netatalk ddp_pcb.c... X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2004 20:47:50 -0000 rwatson 2004-06-12 20:47:32 UTC FreeBSD src repository Modified files: sys/kern kern_descrip.c uipc_socket.c uipc_syscalls.c uipc_usrreq.c sys/net raw_cb.c raw_usrreq.c sys/netatm atm_socket.c sys/netatalk ddp_pcb.c sys/netgraph ng_ksocket.c sys/netgraph/bluetooth/socket ng_btsocket_hci_raw.c ng_btsocket_l2cap.c ng_btsocket_l2cap_raw.c ng_btsocket_rfcomm.c sys/netinet in_pcb.c tcp_subr.c sys/netipx ipx_pcb.c ipx_usrreq.c sys/netnatm natm.c sys/sys socketvar.h Log: Extend coverage of SOCK_LOCK(so) to include so_count, the socket reference count: - Assert SOCK_LOCK(so) macros that directly manipulate so_count: soref(), sorele(). - Assert SOCK_LOCK(so) in macros/functions that rely on the state of so_count: sofree(), sotryfree(). - Acquire SOCK_LOCK(so) before calling these functions or macros in various contexts in the stack, both at the socket and protocol layers. - In some cases, perform soisdisconnected() before sotryfree(), as this could result in frobbing of a non-present socket if sotryfree() actually frees the socket. - Note that sofree()/sotryfree() will release the socket lock even if they don't free the socket. Submitted by: sam Sponsored by: FreeBSD Foundation Obtained from: BSD/OS Revision Changes Path 1.233 +3 -0 src/sys/kern/kern_descrip.c 1.177 +10 -1 src/sys/kern/uipc_socket.c 1.190 +7 -0 src/sys/kern/uipc_syscalls.c 1.123 +1 -0 src/sys/kern/uipc_usrreq.c 1.28 +3 -0 src/sys/net/raw_cb.c 1.33 +3 -1 src/sys/net/raw_usrreq.c 1.43 +1 -0 src/sys/netatalk/ddp_pcb.c 1.20 +1 -0 src/sys/netatm/atm_socket.c 1.15 +1 -0 src/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c 1.13 +2 -0 src/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c 1.12 +1 -0 src/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c 1.9 +3 -0 src/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c 1.43 +2 -0 src/sys/netgraph/ng_ksocket.c 1.148 +1 -0 src/sys/netinet/in_pcb.c 1.190 +3 -2 src/sys/netinet/tcp_subr.c 1.28 +1 -0 src/sys/netipx/ipx_pcb.c 1.40 +2 -1 src/sys/netipx/ipx_usrreq.c 1.33 +2 -0 src/sys/netnatm/natm.c 1.119 +8 -1 src/sys/sys/socketvar.h