From: David Miller <davem@davemloft.net>
To: Aji_Srinivas@emc.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] TCP: zero out rx_opt in tcp_disconnect()
Date: Thu, 03 May 2007 17:31:57 -0700 (PDT) [thread overview]
Message-ID: <20070503.173157.41635650.davem@davemloft.net> (raw)
In-Reply-To: <20070503185336.GA19639@rainfinity.com>
From: Aji_Srinivas@emc.com
Date: Thu, 3 May 2007 11:53:36 -0700
> When the server drops its connection, NFS client reconnects using the
> same socket after disconnecting. If the new connection's SYN,ACK
> doesn't contain the TCP timestamp option and the old connection's did,
> tp->tcp_header_len is recomputed assuming no timestamp header but
> tp->rx_opt.tstamp_ok remains set. Then tcp_build_and_update_options()
> adds in a timestamp option past the end of the allocated TCP header,
> overwriting TCP data, or when the data is in skb_shinfo(skb)->frags[],
> overwriting skb_shinfo(skb) causing a crash soon after. (The issue was
> debugged from such a crash.)
>
> Similarly, wscale_ok and sack_ok also get set based on the SYN,ACK
> packet but not reset on disconnect, since they are zeroed out at
> initialization. The patch zeroes out the entire tp->rx_opt struct in
> tcp_disconnect() to avoid this sort of problem.
>
> Signed-off-by: Srinivas Aji <Aji_Srinivas@emc.com>
Thanks for catching this. It is rare to take advantage of
the connect() with AF_UNSPEC feature that allows this.
Most applications close the socket and make a new one before
connecting again.
I'll apply this fix, thanks a lot.
prev parent reply other threads:[~2007-05-04 0:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-03 18:53 [PATCH] TCP: zero out rx_opt in tcp_disconnect() Aji_Srinivas
2007-05-04 0:31 ` David Miller [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070503.173157.41635650.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=Aji_Srinivas@emc.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).