]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Assert the inpcb lock in tcp_twstart(), which does both read-modify-write
authorrwatson <rwatson@FreeBSD.org>
Tue, 23 Nov 2004 16:23:13 +0000 (16:23 +0000)
committerrwatson <rwatson@FreeBSD.org>
Tue, 23 Nov 2004 16:23:13 +0000 (16:23 +0000)
commit93fe353ec5725020e33859a4dcde70dd9c0334f3
treeb67ae46e3a46c39c67d0c18cfa67d7950a7ab0a6
parent32947f494f39ebc1429459b4beb89f1c642abe0a
Assert the inpcb lock in tcp_twstart(), which does both read-modify-write
on the tcpcb, but also calls into tcp_close() and tcp_twrespond().

Annotate that tcp_twrecycleable() requires the inpcb lock because it does
a series of non-atomic reads of the tcpcb, but is currently called
without the inpcb lock by the caller.  This is a bug.

Assert the inpcb lock in tcp_twclose() as it performs a read-modify-write
of the timewait structure/inpcb, and calls in_pcbdetach() which requires
the lock.

Assert the inpcb lock in tcp_twrespond(), as it performs multiple
non-atomic reads of the tcptw and inpcb structures, as well as calling
mac_create_mbuf_from_inpcb(), tcpip_fillheaders(), which require the
inpcb lock.

MFC after: 2 weeks
sys/netinet/tcp_subr.c
sys/netinet/tcp_timewait.c