From owner-cvs-src Mon Feb 24 0:24:32 2003 Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C826537B401; Mon, 24 Feb 2003 00:24:28 -0800 (PST) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0B0E043FBD; Mon, 24 Feb 2003 00:24:28 -0800 (PST) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id D5CD6AE162; Mon, 24 Feb 2003 00:24:27 -0800 (PST) Date: Mon, 24 Feb 2003 00:24:27 -0800 From: Alfred Perlstein To: phk@phk.freebsd.dk Cc: Scott Long , src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern kern_descrip.c Message-ID: <20030224082427.GL27224@elvis.mu.org> References: <20030224062842.GK27224@elvis.mu.org> <27244.1046074268@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=unknown-8bit Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <27244.1046074268@critter.freebsd.dk> User-Agent: Mutt/1.4i Sender: owner-cvs-src@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG * phk@phk.freebsd.dk [030224 00:11] wrote: > In message <20030224062842.GK27224@elvis.mu.org>, Alfred Perlstein writes: > >* Scott Long [030223 21:47] wrote: > >> scottl 2003/02/23 21:46:55 PST > >> > >> Modified files: > >> sys/kern kern_descrip.c > >> Log: > >> Don't NULL out p_fd until after closefd() has been called. This isn't > >> totally correct, but it has caused breakage for too long. I welcome > >> someone with more fd fu to fix it correctly. > > > >Could you at least use a comment that explains why it doesn't work? :) > >I detailed it to you in several emails. > > It børks a diskless machine, I posted the details to current@ some days ago. No, I realized relatively quickly what had gone wrong once someone posted a backtrace, I think it was scott. I also explained to scott why the ordering is needed. Right now he has rebroken the mp safety of filedescs so instead of a problem that's quite easy to find we have broken code that's racey and can lead to crashes. Since no one seems to either care or understand the problem, I'll detail it here: If you don't NULL out the filedesc pointer unconditionally in fdfree() you wind up leaving an invalid reference through the fdesc_mtx barrier, thereby defeating the barrier. This can lead to the file sysctl code or that other place dereferencing a filedesc as it's being free'd or after it has been free()'d. Anyhow, it sucks, but I'll probably get to it when I'm less disgusted with what's been going on lately. later, -Alfred To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-src" in the body of the message