android_kernel_samsung_a7y1.../net/ipv4
Pengcheng Yang 520cf236cd tcp: fix marked lost packets not being retransmitted
[ Upstream commit e176b1ba476cf36f723cfcc7a9e57f3cb47dec70 ]

When the packet pointed to by retransmit_skb_hint is unlinked by ACK,
retransmit_skb_hint will be set to NULL in tcp_clean_rtx_queue().
If packet loss is detected at this time, retransmit_skb_hint will be set
to point to the current packet loss in tcp_verify_retransmit_hint(),
then the packets that were previously marked lost but not retransmitted
due to the restriction of cwnd will be skipped and cannot be
retransmitted.

To fix this, when retransmit_skb_hint is NULL, retransmit_skb_hint can
be reset only after all marked lost packets are retransmitted
(retrans_out >= lost_out), otherwise we need to traverse from
tcp_rtx_queue_head in tcp_xmit_retransmit_queue().

Packetdrill to demonstrate:

// Disable RACK and set max_reordering to keep things simple
    0 `sysctl -q net.ipv4.tcp_recovery=0`
   +0 `sysctl -q net.ipv4.tcp_max_reordering=3`

// Establish a connection
   +0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
   +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
   +0 bind(3, ..., ...) = 0
   +0 listen(3, 1) = 0

  +.1 < S 0:0(0) win 32792 <mss 1000,sackOK,nop,nop,nop,wscale 7>
   +0 > S. 0:0(0) ack 1 <...>
 +.01 < . 1:1(0) ack 1 win 257
   +0 accept(3, ..., ...) = 4

// Send 8 data segments
   +0 write(4, ..., 8000) = 8000
   +0 > P. 1:8001(8000) ack 1

// Enter recovery and 1:3001 is marked lost
 +.01 < . 1:1(0) ack 1 win 257 <sack 3001:4001,nop,nop>
   +0 < . 1:1(0) ack 1 win 257 <sack 5001:6001 3001:4001,nop,nop>
   +0 < . 1:1(0) ack 1 win 257 <sack 5001:7001 3001:4001,nop,nop>

// Retransmit 1:1001, now retransmit_skb_hint points to 1001:2001
   +0 > . 1:1001(1000) ack 1

// 1001:2001 was ACKed causing retransmit_skb_hint to be set to NULL
 +.01 < . 1:1(0) ack 2001 win 257 <sack 5001:8001 3001:4001,nop,nop>
// Now retransmit_skb_hint points to 4001:5001 which is now marked lost

// BUG: 2001:3001 was not retransmitted
   +0 > . 2001:3001(1000) ack 1

Signed-off-by: Pengcheng Yang <yangpc@wangsu.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Tested-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-07 13:38:41 +02:00
..
netfilter netfilter: arp_tables: init netns pointer in xt_tgchk_param struct 2020-04-07 13:33:06 +02:00
af_inet.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ah4.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
arp.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
cipso_ipv4.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
datagram.c inet: stop leaking jiffies on the wire 2020-04-07 09:29:41 +02:00
devinet.c inet: protect against too small mtu values. 2020-04-07 13:12:32 +02:00
esp4.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
fib_frontend.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
fib_lookup.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
fib_rules.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
fib_semantics.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
fib_trie.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
fou.c net: fou: do not use guehdr after iptunnel_pull_offloads in gue_udp_recv 2020-04-06 15:28:33 +02:00
gre_demux.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
gre_offload.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
icmp.c net: icmp: fix data-race in cmp_global_allow() 2020-04-07 13:24:00 +02:00
igmp.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
inet_connection_sock.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
inet_diag.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
inet_fragment.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
inet_hashtables.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
inet_lro.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
inet_timewait_sock.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
inetpeer.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ip_forward.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ip_fragment.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ip_gre.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ip_input.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ip_options.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ip_output.c inet: protect against too small mtu values. 2020-04-07 13:12:32 +02:00
ip_sockglue.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ip_tunnel_core.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ip_tunnel.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ip_vti.c vti4: ipip tunnel deregistration fixes. 2020-04-06 18:14:33 +02:00
ipcomp.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ipconfig.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ipip.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ipmr.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kconfig A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Makefile A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
netfilter.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ping.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
proc.c tcp: tcp_fragment() should apply sane memory limits 2020-04-06 18:57:16 +02:00
protocol.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
raw.c ipv4: Use return value of inet_iif() for __raw_v4_lookup in the while loop 2020-04-06 19:17:31 +02:00
route.c ipv4: Return -ENETUNREACH if we can't create route but saddr is valid 2020-04-07 09:26:23 +02:00
syncookies.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sysctl_net_ipv4.c tcp: add tcp_min_snd_mss sysctl 2020-04-06 18:57:31 +02:00
sysfs_net_ipv4.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tcp_bic.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tcp_cdg.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tcp_cong.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tcp_cubic.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tcp_dctcp.c tcp: Ensure DCTCP reacts to losses 2020-04-06 15:07:51 +02:00
tcp_diag.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tcp_fastopen.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tcp_highspeed.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tcp_htcp.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tcp_hybla.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tcp_illinois.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tcp_input.c tcp: fix marked lost packets not being retransmitted 2020-04-07 13:38:41 +02:00
tcp_ipv4.c inet: stop leaking jiffies on the wire 2020-04-07 09:29:41 +02:00
tcp_lp.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tcp_memcontrol.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tcp_metrics.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tcp_minisocks.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tcp_offload.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tcp_output.c tcp: do not send empty skb from tcp_write_xmit() 2020-04-07 13:24:05 +02:00
tcp_probe.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tcp_recovery.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tcp_scalable.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tcp_timer.c tcp: fix off-by-one bug on aborting window-probing socket 2020-04-07 12:45:15 +02:00
tcp_vegas.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tcp_vegas.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tcp_veno.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tcp_westwood.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tcp_yeah.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tcp.c tcp: Reset bytes_acked and bytes_received when disconnecting 2020-04-06 20:05:24 +02:00
tunnel4.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
udp_diag.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
udp_impl.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
udp_offload.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
udp_tunnel.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
udp.c net : disable KNOX_NCM 2020-03-27 22:13:21 +05:30
udplite.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xfrm4_input.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xfrm4_mode_beet.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xfrm4_mode_transport.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xfrm4_mode_tunnel.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xfrm4_output.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xfrm4_policy.c xfrm4: Fix uninitialized memory read in _decode_session4 2020-04-06 18:14:35 +02:00
xfrm4_protocol.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xfrm4_state.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xfrm4_tunnel.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30