diff options
author | rwatson <rwatson@FreeBSD.org> | 2006-04-04 12:26:07 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2006-04-04 12:26:07 +0000 |
commit | 2e3d21db7b554ea3c353bf7f436a3adcc1d0a40a (patch) | |
tree | 3ae678c38dc3a2f611a58b8c87c8c1104c4a32b7 /sys/netinet/tcp_reass.c | |
parent | c728727d1bde760303ed2b7f1503985cf5d06ede (diff) | |
download | FreeBSD-src-2e3d21db7b554ea3c353bf7f436a3adcc1d0a40a.zip FreeBSD-src-2e3d21db7b554ea3c353bf7f436a3adcc1d0a40a.tar.gz |
Before dereferencing intotw() when INP_TIMEWAIT, check for inp_ppcb being
NULL. We currently do allow this to happen, but may want to remove that
possibility in the future. This case can occur when a socket is left
open after TCP wraps up, and the timewait state is recycled. This will
be cleaned up in the future.
Found by: Kazuaki Oda <kaakun at highway dot ne dot jp>
MFC after: 3 months
Diffstat (limited to 'sys/netinet/tcp_reass.c')
-rw-r--r-- | sys/netinet/tcp_reass.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c index 8662ffc..ad94e76 100644 --- a/sys/netinet/tcp_reass.c +++ b/sys/netinet/tcp_reass.c @@ -3156,6 +3156,15 @@ tcp_timewait(tw, to, th, m, tlen) const int isipv6 = 0; #endif + /* + * XXXRW: Time wait state for inpcb has been recycled, but inpcb is + * still present. This is undesirable, but temporarily necessary + * until we work out how to handle inpcb's who's timewait state has + * been removed. + */ + if (tw == NULL) + goto drop; + /* tcbinfo lock required for tcp_twclose(), tcp_2msl_reset. */ INP_INFO_WLOCK_ASSERT(&tcbinfo); INP_LOCK_ASSERT(tw->tw_inpcb); |