original_kernel/net/ipv4
Eric Dumazet a41e8a88b0 tcp: better handle TCP_USER_TIMEOUT in SYN_SENT state
Yuchung Cheng and Marek Majkowski independently reported a weird
behavior of TCP_USER_TIMEOUT option when used at connect() time.

When the TCP_USER_TIMEOUT is reached, tcp_write_timeout()
believes the flow should live, and the following condition
in tcp_clamp_rto_to_user_timeout() programs one jiffie timers :

    remaining = icsk->icsk_user_timeout - elapsed;
    if (remaining <= 0)
        return 1; /* user timeout has passed; fire ASAP */

This silly situation ends when the max syn rtx count is reached.

This patch makes sure we honor both TCP_SYNCNT and TCP_USER_TIMEOUT,
avoiding these spurious SYN packets.

Fixes: b701a99e43 ("tcp: Add tcp_clamp_rto_to_user_timeout() helper to improve accuracy")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Yuchung Cheng <ycheng@google.com>
Reported-by: Marek Majkowski <marek@cloudflare.com>
Cc: Jon Maxwell <jmaxwell37@gmail.com>
Link: https://marc.info/?l=linux-netdev&m=156940118307949&w=2
Acked-by: Jon Maxwell <jmaxwell37@gmail.com>
Tested-by: Marek Majkowski <marek@cloudflare.com>
Signed-off-by: Marek Majkowski <marek@cloudflare.com>
Acked-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-27 20:42:24 +02:00
..
bpfilter
netfilter netfilter: fix coding-style errors. 2019-09-13 11:39:38 +02:00
Kconfig net: Fix Kconfig indentation 2019-09-26 08:56:17 +02:00
Makefile
af_inet.c
ah4.c
arp.c
cipso_ipv4.c
datagram.c udp: correct reuseport selection with connected sockets 2019-09-16 09:02:18 +02:00
devinet.c
esp4.c
esp4_offload.c
fib_frontend.c
fib_lookup.h
fib_notifier.c
fib_rules.c
fib_semantics.c net: Properly update v4 routes with v6 nexthop 2019-09-05 12:35:58 +02:00
fib_trie.c
fou.c
gre_demux.c
gre_offload.c
icmp.c
igmp.c
inet_connection_sock.c ipv4: Revert removal of rt_uses_gateway 2019-09-20 18:23:33 -07:00
inet_diag.c
inet_fragment.c
inet_hashtables.c
inet_timewait_sock.c
inetpeer.c
ip_forward.c ipv4: Revert removal of rt_uses_gateway 2019-09-20 18:23:33 -07:00
ip_fragment.c
ip_gre.c
ip_input.c
ip_options.c
ip_output.c tcp: honor SO_PRIORITY in TIME_WAIT state 2019-09-27 12:05:02 +02:00
ip_sockglue.c
ip_tunnel.c
ip_tunnel_core.c
ip_vti.c
ipcomp.c
ipconfig.c
ipip.c
ipmr.c ipmr: remove hard code cache_resolve_queue_len limit 2019-09-07 17:49:00 +02:00
ipmr_base.c
metrics.c
netfilter.c
netlink.c
nexthop.c
ping.c ip: support SO_MARK cmsg 2019-09-13 21:44:19 +02:00
proc.c
protocol.c
raw.c ip: support SO_MARK cmsg 2019-09-13 21:44:19 +02:00
raw_diag.c
route.c ipv4: Revert removal of rt_uses_gateway 2019-09-20 18:23:33 -07:00
syncookies.c
sysctl_net_ipv4.c
tcp.c tcp: Add snd_wnd to TCP_INFO 2019-09-16 16:26:11 +02:00
tcp_bbr.c tcp_bbr: fix quantization code to not raise cwnd if not probing bandwidth 2019-09-27 20:37:50 +02:00
tcp_bic.c
tcp_bpf.c
tcp_cdg.c
tcp_cong.c
tcp_cubic.c
tcp_dctcp.c
tcp_dctcp.h
tcp_diag.c tcp: ulp: fix possible crash in tcp_diag_get_aux_size() 2019-09-07 17:32:28 +02:00
tcp_fastopen.c
tcp_highspeed.c
tcp_htcp.c
tcp_hybla.c
tcp_illinois.c
tcp_input.c tcp: Add TCP_INFO counter for packets received out-of-order 2019-09-16 16:26:11 +02:00
tcp_ipv4.c tcp: honor SO_PRIORITY in TIME_WAIT state 2019-09-27 12:05:02 +02:00
tcp_lp.c
tcp_metrics.c
tcp_minisocks.c tcp: honor SO_PRIORITY in TIME_WAIT state 2019-09-27 12:05:02 +02:00
tcp_nv.c
tcp_offload.c
tcp_output.c tcp: force a PSH flag on TSO packets 2019-09-11 23:59:01 +01:00
tcp_rate.c
tcp_recovery.c
tcp_scalable.c
tcp_timer.c tcp: better handle TCP_USER_TIMEOUT in SYN_SENT state 2019-09-27 20:42:24 +02:00
tcp_ulp.c
tcp_vegas.c
tcp_vegas.h
tcp_veno.c
tcp_westwood.c
tcp_yeah.c
tunnel4.c
udp.c Merge ra.kernel.org:/pub/scm/linux/kernel/git/netdev/net 2019-09-17 23:51:10 +02:00
udp_diag.c
udp_impl.h
udp_offload.c
udp_tunnel.c
udplite.c
xfrm4_input.c
xfrm4_output.c
xfrm4_policy.c ipv4: Revert removal of rt_uses_gateway 2019-09-20 18:23:33 -07:00
xfrm4_protocol.c
xfrm4_state.c
xfrm4_tunnel.c