summaryrefslogtreecommitdiff
path: root/net/ipv4/tcp_probe.c
diff options
context:
space:
mode:
authorJerry Chu <hkchu@google.com>2011-01-25 13:46:30 -0800
committerDavid S. Miller <davem@davemloft.net>2011-01-25 13:46:30 -0800
commit44f5324b5d13ef2187729d949eca442689627f39 (patch)
tree1b53aabed696b8b3099ac2872a7bfe5d5ce24ad3 /net/ipv4/tcp_probe.c
parent73a8bd74e2618990dbb218c3d82f53e60acd9af0 (diff)
TCP: fix a bug that triggers large number of TCP RST by mistake
This patch fixes a bug that causes TCP RST packets to be generated on otherwise correctly behaved applications, e.g., no unread data on close,..., etc. To trigger the bug, at least two conditions must be met: 1. The FIN flag is set on the last data packet, i.e., it's not on a separate, FIN only packet. 2. The size of the last data chunk on the receive side matches exactly with the size of buffer posted by the receiver, and the receiver closes the socket without any further read attempt. This bug was first noticed on our netperf based testbed for our IW10 proposal to IETF where a large number of RST packets were observed. netperf's read side code meets the condition 2 above 100%. Before the fix, tcp_data_queue() will queue the last skb that meets condition 1 to sk_receive_queue even though it has fully copied out (skb_copy_datagram_iovec()) the data. Then if condition 2 is also met, tcp_recvmsg() often returns all the copied out data successfully without actually consuming the skb, due to a check "if ((chunk = len - tp->ucopy.len) != 0) {" and "len -= chunk;" after tcp_prequeue_process() that causes "len" to become 0 and an early exit from the big while loop. I don't see any reason not to free the skb whose data have been fully consumed in tcp_data_queue(), regardless of the FIN flag. We won't get there if MSG_PEEK is on. Am I missing some arcane cases related to urgent data? Signed-off-by: H.K. Jerry Chu <hkchu@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_probe.c')
0 files changed, 0 insertions, 0 deletions