]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
tcp: dont handle MTU reduction on LISTEN socket
authorEric Dumazet <edumazet@google.com>
Mon, 18 Mar 2013 07:01:28 +0000 (07:01 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 Mar 2013 17:31:28 +0000 (13:31 -0400)
commit0d4f0608619de59fd8169dd8e72aadc28d80e715
tree22a078ce17e33c82c1809594ce1b761c9e30a3d3
parentb009aac12cd0fe34293c68af8ac48b85be3bd858
tcp: dont handle MTU reduction on LISTEN socket

When an ICMP ICMP_FRAG_NEEDED (or ICMPV6_PKT_TOOBIG) message finds a
LISTEN socket, and this socket is currently owned by the user, we
set TCP_MTU_REDUCED_DEFERRED flag in listener tsq_flags.

This is bad because if we clone the parent before it had a chance to
clear the flag, the child inherits the tsq_flags value, and next
tcp_release_cb() on the child will decrement sk_refcnt.

Result is that we might free a live TCP socket, as reported by
Dormando.

IPv4: Attempt to release TCP socket in state 1

Fix this issue by testing sk_state against TCP_LISTEN early, so that we
set TCP_MTU_REDUCED_DEFERRED on appropriate sockets (not a LISTEN one)

This bug was introduced in commit 563d34d05786
(tcp: dont drop MTU reduction indications)

Reported-by: dormando <dormando@rydia.net>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_ipv4.c
net/ipv6/tcp_ipv6.c