From owner-cvs-src@FreeBSD.ORG Thu Mar 1 11:07:19 2007 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6C0DE16A402; Thu, 1 Mar 2007 11:07:19 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 6157913C442; Thu, 1 Mar 2007 11:07:19 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id l21B7J4X047598; Thu, 1 Mar 2007 11:07:19 GMT (envelope-from rwatson@repoman.freebsd.org) Received: (from rwatson@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id l21B7J6T047597; Thu, 1 Mar 2007 11:07:19 GMT (envelope-from rwatson) Message-Id: <200703011107.l21B7J6T047597@repoman.freebsd.org> From: Robert Watson Date: Thu, 1 Mar 2007 11:07:18 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: RELENG_6 Cc: Subject: cvs commit: src/sys/kern uipc_usrreq.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2007 11:07:19 -0000 rwatson 2007-03-01 11:07:18 UTC FreeBSD src repository Modified files: (Branch: RELENG_6) sys/kern uipc_usrreq.c Log: Merge uipc_usrreq.c:1.183 from HEAD to RELENG_6: Close a race that occurs when using sendto() to connect and send on a UNIX domain socket at the same time as the remote host is closing the new connections as quickly as they open. Since the connect() and send() paths are non-atomic with respect to another, it is possible for the second thread's close() call to disconnect the two sockets as connect() returns, leading to the consumer (which plans to send()) with a NULL kernel pointer to its proposed peer. As a result, after acquiring the UNIX domain socket subsystem lock, we need to revalidate the connection pointers even though connect() has technically succeed, and reurn an error to say that there's no connection on which to perform the send. We might want to rethink the specific errno number, perhaps ECONNRESET would be better. Reported by: Young Hyun PR: 100940 Revision Changes Path 1.155.2.9 +23 -2 src/sys/kern/uipc_usrreq.c