kernel_optimize_test/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
af_inet.c net: remove empty inet_exit_net 2019-08-19 18:22:54 -07:00
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 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-07-08 19:48:57 -07:00
esp4_offload.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next 2019-07-05 15:01:15 -07:00
esp4.c xfrm: remove get_mtu indirection from xfrm_type 2019-07-01 06:16:40 +02:00
fib_frontend.c ipv4: Add lockdep condition to fix for_each_entry() 2019-08-09 11:01:08 -07:00
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 net: route dump netlink NLM_F_MULTI flag missing 2019-08-24 16:49:48 -07:00
fou.c
gre_demux.c net: remove unused parameter from skb_checksum_try_convert 2019-07-05 15:30:36 -07:00
gre_offload.c
icmp.c ipv4/icmp: fix rt dst dev null pointer dereference 2019-08-24 14:49:35 -07:00
igmp.c net: fix __ip_mc_inc_group usage 2019-08-20 12:48:06 -07:00
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: frags: re-introduce skb coalescing for local delivery 2019-08-08 15:55:10 -07:00
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 inet: frags: re-introduce skb coalescing for local delivery 2019-08-08 15:55:10 -07:00
ip_gre.c
ip_input.c
ip_options.c netfilter: nf_tables: add support for matching IPv4 options 2019-06-21 18:35:51 +02:00
ip_output.c tcp: honor SO_PRIORITY in TIME_WAIT state 2019-09-27 12:05:02 +02:00
ip_sockglue.c
ip_tunnel_core.c ip_tunnel: allow not to count pkts on tstats by setting skb's dev to NULL 2019-06-18 20:48:45 -04:00
ip_tunnel.c
ip_vti.c
ipcomp.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next 2019-07-05 15:01:15 -07:00
ipconfig.c
ipip.c ipip: validate header length in ipip_tunnel_xmit 2019-07-25 17:23:40 -07:00
ipmr_base.c
ipmr.c ipmr: remove hard code cache_resolve_queue_len limit 2019-09-07 17:49:00 +02:00
Kconfig net: Fix Kconfig indentation 2019-09-26 08:56:17 +02:00
Makefile
metrics.c
netfilter.c
netlink.c
nexthop.c nexthops: remove redundant assignment to variable err 2019-08-22 12:14:05 -07:00
ping.c ip: support SO_MARK cmsg 2019-09-13 21:44:19 +02:00
proc.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-06-17 20:20:36 -07:00
protocol.c
raw_diag.c net: don't warn in inet diag when IPV6 is disabled 2019-07-03 11:26:35 -07:00
raw.c ip: support SO_MARK cmsg 2019-09-13 21:44:19 +02:00
route.c ipv4: Revert removal of rt_uses_gateway 2019-09-20 18:23:33 -07:00
syncookies.c
sysctl_net_ipv4.c tcp: add new tcp_mtu_probe_floor sysctl 2019-08-09 13:03:30 -07: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 net/tls: prevent skb_orphan() from leaking TLS plain text with offload 2019-08-08 22:39:35 -07:00
tcp_cdg.c
tcp_cong.c tcp: fix tcp_set_congestion_control() use from bpf hook 2019-07-18 20:33:48 -07:00
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 net: fastopen: robustness and endianness fixes for SipHash 2019-06-22 16:30:37 -07:00
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 bpf: sockmap/tls, close can race with map free 2019-07-22 16:04:17 +02:00
tcp_vegas.c
tcp_vegas.h
tcp_veno.c
tcp_westwood.c
tcp_yeah.c
tcp.c tcp: Add snd_wnd to TCP_INFO 2019-09-16 16:26:11 +02:00
tunnel4.c
udp_diag.c
udp_impl.h
udp_offload.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-06-22 08:59:24 -04:00
udp_tunnel.c
udp.c Merge ra.kernel.org:/pub/scm/linux/kernel/git/netdev/net 2019-09-17 23:51:10 +02:00
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