Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Jan 2012 08:40:04 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-net@freebsd.org
Cc:        Robert Watson <rwatson@freebsd.org>, Navdeep Parhar <nparhar@gmail.com>
Subject:   Re: tcp_detach can return with inpcb lock held
Message-ID:  <201201060840.04156.jhb@freebsd.org>
In-Reply-To: <alpine.BSF.2.00.1201061120001.31024@fledge.watson.org>
References:  <CAPFoGT-S-gvp12dGBZewEEZUFrWaOL=V4Jotu-pgzOEpcHs7Xg@mail.gmail.com> <alpine.BSF.2.00.1201061120001.31024@fledge.watson.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday, January 06, 2012 6:22:25 am Robert Watson wrote:
> 
> On Thu, 5 Jan 2012, Navdeep Parhar wrote:
> 
> > Looks like there's a case where tcp_detach could return with the inp lock 
> > held.  I see an XXXRW comment questioning this possibility, but we should 
> > either add an assertion to verify that the case does not occur, or unlock 
> > the inpcb before returning.  Or maybe both?
> 
> Hi Navdeep:
> 
> A number of other folks have pointed this out as well -- usually while 
> tracking a different bug, so a fix never gets committed.  I believe we should 
> commit + merge the patch you've proposed.  However, as far as I'm aware, it's 
> never triggered, so the comment is probably correct.  I'm not sure if we want 
> to make the comment an invariant, since other than avoiding this bug, it 
> shouldn't need to be true (I think).

If you really think it shouldn't occur, then commit the patch below and MFC it
to stable branches, but change the code in HEAD afterwards to add the assertion.
Then you will eventually find out if it's wrong (hopefully) as I did with the
assertions I added to tcp_input() for rcv_nxt and rcv_adv. :)

-- 
John Baldwin



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