From owner-cvs-all Tue May 28 16: 1:38 2002 Delivered-To: cvs-all@freebsd.org Received: from mail.speakeasy.net (mail14.speakeasy.net [216.254.0.214]) by hub.freebsd.org (Postfix) with ESMTP id F044D37B404 for ; Tue, 28 May 2002 16:01:33 -0700 (PDT) Received: (qmail 8920 invoked from network); 28 May 2002 23:01:32 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail14.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 28 May 2002 23:01:32 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.11.6/8.11.6) with ESMTP id g4SN1kF25384; Tue, 28 May 2002 19:01:46 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200205282251.g4SMpk6g008704@khavrinen.lcs.mit.edu> Date: Tue, 28 May 2002 19:01:13 -0400 (EDT) From: John Baldwin To: Garrett Wollman Subject: Re: cvs commit: src/sys/kern uipc_socket.c Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 28-May-2002 Garrett Wollman wrote: > < said: > >> We allocate a new socket, with _NO_ other references to it from anyone else. > > There is no guarantee that there are no other references to it, since > it is possible for the socket to be recycled in between the time it is > marked for export by the sysctl helper function and the time it is > actually copied out. The zone allocator recycled objects in FIFO > order; I'm not sure what the behavior of UMA is in this regard. UMA only gives us a socket that has been uma_zfree()'d. The sysctl helper should gain a reference to each socket while holding an appropriate lock on the list before the copyout and drop it around the copyout if it is not doing so already. If it does that then a socket won't be free'd out from under the sysctl function. This is not all that unusual of a race and if this is the one you are talking about it should be documented in the sysctl helper where the fix will need to be applied, not in soalloc(). > -GAWollman -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message