diff options
author | David S. Miller <davem@davemloft.net> | 2010-11-12 13:35:00 -0800 |
---|---|---|
committer | Paul Gortmaker <paul.gortmaker@windriver.com> | 2011-04-17 16:16:02 -0400 |
commit | 7be07193f5663cd1a4657062c47c07282fbc3f3b (patch) | |
tree | 1381c6065bad1341bc7dbe36bb883acc359970eb /net | |
parent | 0130382485c1330f40a8f5090f1ea70c6baa20e6 (diff) | |
download | linux-stable-7be07193f5663cd1a4657062c47c07282fbc3f3b.tar.gz linux-stable-7be07193f5663cd1a4657062c47c07282fbc3f3b.tar.bz2 linux-stable-7be07193f5663cd1a4657062c47c07282fbc3f3b.zip |
tcp: Don't change unlocked socket state in tcp_v4_err().
commit 8f49c2703b33519aaaccc63f571b465b9d2b3a2d upstream
Alexey Kuznetsov noticed a regression introduced by
commit f1ecd5d9e7366609d640ff4040304ea197fbc618
("Revert Backoff [v3]: Revert RTO on ICMP destination unreachable")
The RTO and timer modification code added to tcp_v4_err()
doesn't check sock_owned_by_user(), which if true means we
don't have exclusive access to the socket and therefore cannot
modify it's critical state.
Just skip this new code block if sock_owned_by_user() is true
and eliminate the now superfluous sock_owned_by_user() code
block contained within.
Reported-by: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
CC: Damian Lukowski <damian@tvk.rwth-aachen.de>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 3c23e70885f4..ea51c2f11800 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -411,6 +411,9 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info) !icsk->icsk_backoff) break; + if (sock_owned_by_user(sk)) + break; + icsk->icsk_backoff--; inet_csk(sk)->icsk_rto = __tcp_set_rto(tp) << icsk->icsk_backoff; @@ -425,11 +428,6 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info) if (remaining) { inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, remaining, TCP_RTO_MAX); - } else if (sock_owned_by_user(sk)) { - /* RTO revert clocked out retransmission, - * but socket is locked. Will defer. */ - inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, - HZ/20, TCP_RTO_MAX); } else { /* RTO revert clocked out retransmission. * Will retransmit now */ |