From owner-cvs-all@FreeBSD.ORG Mon Jul 31 23:00:06 2006 Return-Path: X-Original-To: cvs-all@FreeBSD.org 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 92C1716A4DD; Mon, 31 Jul 2006 23:00:06 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4AF4343D49; Mon, 31 Jul 2006 23:00:06 +0000 (GMT) (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 k6VN06vx089924; Mon, 31 Jul 2006 23:00:06 GMT (envelope-from rwatson@repoman.freebsd.org) Received: (from rwatson@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k6VN06sQ089923; Mon, 31 Jul 2006 23:00:06 GMT (envelope-from rwatson) Message-Id: <200607312300.k6VN06sQ089923@repoman.freebsd.org> From: Robert Watson Date: Mon, 31 Jul 2006 23:00:05 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/kern uipc_usrreq.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 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: Mon, 31 Jul 2006 23:00:06 -0000 rwatson 2006-07-31 23:00:05 UTC FreeBSD src repository Modified files: sys/kern uipc_usrreq.c Log: 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. PR: 100940 Reported by: Young Hyun MFC after: 2 weeks MFC note: Some adaptation will be required Revision Changes Path 1.183 +22 -2 src/sys/kern/uipc_usrreq.c