Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Feb 2003 00:24:27 -0800
From:      Alfred Perlstein <bright@mu.org>
To:        phk@phk.freebsd.dk
Cc:        Scott Long <scottl@FreeBSD.org>, 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>
In-Reply-To: <27244.1046074268@critter.freebsd.dk>
References:  <20030224062842.GK27224@elvis.mu.org> <27244.1046074268@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
* phk@phk.freebsd.dk <phk@phk.freebsd.dk> [030224 00:11] wrote:
> In message <20030224062842.GK27224@elvis.mu.org>, Alfred Perlstein writes:
> >* Scott Long <scottl@FreeBSD.org> [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-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030224082427.GL27224>