android_kernel_motorola_sm6375/net/ipv4
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Yonglong Li fd35e34ece tcp: make retransmitted SKB fit into the send window
[ Upstream commit 536a6c8e05f95e3d1118c40ae8b3022ee2d05d52 ]

current code of __tcp_retransmit_skb only check TCP_SKB_CB(skb)->seq
in send window, and TCP_SKB_CB(skb)->seq_end maybe out of send window.
If receiver has shrunk his window, and skb is out of new window,  it
should retransmit a smaller portion of the payload.

test packetdrill script:
    0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
   +0 fcntl(3, F_GETFL) = 0x2 (flags O_RDWR)
   +0 fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0

   +0 connect(3, ..., ...) = -1 EINPROGRESS (Operation now in progress)
   +0 > S 0:0(0)  win 65535 <mss 1460,sackOK,TS val 100 ecr 0,nop,wscale 8>
 +.05 < S. 0:0(0) ack 1 win 6000 <mss 1000,nop,nop,sackOK>
   +0 > . 1:1(0) ack 1

   +0 write(3, ..., 10000) = 10000

   +0 > . 1:2001(2000) ack 1 win 65535
   +0 > . 2001:4001(2000) ack 1 win 65535
   +0 > . 4001:6001(2000) ack 1 win 65535

 +.05 < . 1:1(0) ack 4001 win 1001

and tcpdump show:
192.168.226.67.55 > 192.0.2.1.8080: Flags [.], seq 1:2001, ack 1, win 65535, length 2000
192.168.226.67.55 > 192.0.2.1.8080: Flags [.], seq 2001:4001, ack 1, win 65535, length 2000
192.168.226.67.55 > 192.0.2.1.8080: Flags [P.], seq 4001:5001, ack 1, win 65535, length 1000
192.168.226.67.55 > 192.0.2.1.8080: Flags [.], seq 5001:6001, ack 1, win 65535, length 1000
192.0.2.1.8080 > 192.168.226.67.55: Flags [.], ack 4001, win 1001, length 0
192.168.226.67.55 > 192.0.2.1.8080: Flags [.], seq 5001:6001, ack 1, win 65535, length 1000
192.168.226.67.55 > 192.0.2.1.8080: Flags [P.], seq 4001:5001, ack 1, win 65535, length 1000

when cient retract window to 1001, send window is [4001,5002],
but TLP send 5001-6001 packet which is out of send window.

Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Signed-off-by: Yonglong Li <liyonglong@chinatelecom.cn>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/1657532838-20200-1-git-send-email-liyonglong@chinatelecom.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-08-25 11:17:43 +02:00
..
bpfilter
netfilter
af_inet.c tcp: Fix data-races around sysctl_tcp_fastopen. 2022-07-29 17:14:13 +02:00
ah4.c
arp.c ipv4: Invalidate neighbour for broadcast address upon address addition 2022-04-15 14:18:33 +02:00
cipso_ipv4.c cipso: Fix data-races around sysctl. 2022-07-21 20:59:20 +02:00
datagram.c
devinet.c
esp4.c esp: limit skb_page_frag_refill use to a single page 2022-07-12 16:30:45 +02:00
esp4_offload.c
fib_frontend.c ipv4: Invalidate neighbour for broadcast address upon address addition 2022-04-15 14:18:33 +02:00
fib_lookup.h
fib_notifier.c
fib_rules.c
fib_semantics.c ipv4: Fix a data-race around sysctl_fib_multipath_use_neigh. 2022-07-29 17:14:14 +02:00
fib_trie.c ipv4: Fix a data-race around sysctl_fib_sync_mem. 2022-07-21 20:59:21 +02:00
fou.c
gre_demux.c
gre_offload.c
icmp.c ip: Fix data-races around sysctl_ip_no_pmtu_disc. 2022-07-29 17:14:10 +02:00
igmp.c igmp: Fix data-races around sysctl_igmp_qrv. 2022-08-03 11:59:39 +02:00
inet_connection_sock.c tcp: fix race condition when creating child sockets from syncookies 2022-04-27 13:50:45 +02:00
inet_diag.c
inet_fragment.c
inet_hashtables.c tcp: drop the hash_32() part from the index calculation 2022-06-25 12:44:36 +02:00
inet_timewait_sock.c
inetpeer.c inetpeer: Fix data-races around sysctl. 2022-07-21 20:59:20 +02:00
ip_forward.c
ip_fragment.c
ip_gre.c erspan: do not assume transport header is always set 2022-06-29 08:58:46 +02:00
ip_input.c
ip_options.c
ip_output.c ipv4: tcp: send zero IPID in SYNACK messages 2022-02-01 17:24:39 +01:00
ip_sockglue.c
ip_tunnel.c
ip_tunnel_core.c
ip_vti.c
ipcomp.c
ipconfig.c
ipip.c
ipmr.c ipmr,ip6mr: acquire RTNL before calling ip[6]mr_free_table() on failure path 2022-02-16 12:52:51 +01:00
ipmr_base.c
Kconfig
Makefile
metrics.c
netfilter.c
netlink.c
nexthop.c
ping.c ping: fix address binding wrt vrf 2022-05-18 09:47:28 +02:00
proc.c
protocol.c
raw.c ipv4: raw: lock the socket in raw_bind() 2022-02-01 17:24:39 +01:00
raw_diag.c
route.c ip: Fix data-races around sysctl_ip_fwd_use_pmtu. 2022-07-29 17:14:10 +02:00
syncookies.c tcp: Fix data-races around sysctl knobs related to SYN option. 2022-07-29 17:14:14 +02:00
sysctl_net_ipv4.c
tcp.c tcp: Fix a data-race around sysctl_tcp_autocorking. 2022-08-03 11:59:39 +02:00
tcp_bbr.c
tcp_bic.c
tcp_bpf.c bpf, sockmap: Fix double uncharge the mem of sk_msg 2022-04-15 14:18:16 +02:00
tcp_cdg.c
tcp_cong.c
tcp_cubic.c
tcp_dctcp.c
tcp_dctcp.h
tcp_diag.c
tcp_fastopen.c tcp: Fix data-races around sysctl_tcp_fastopen. 2022-07-29 17:14:13 +02:00
tcp_highspeed.c
tcp_htcp.c
tcp_hybla.c
tcp_illinois.c
tcp_input.c tcp: Fix a data-race around sysctl_tcp_comp_sack_nr. 2022-08-03 11:59:40 +02:00
tcp_ipv4.c tcp: Fix a data-race around sysctl_tcp_tw_reuse. 2022-07-29 17:14:13 +02:00
tcp_lp.c
tcp_metrics.c tcp: Fix a data-race around sysctl_tcp_nometrics_save. 2022-08-03 11:59:38 +02:00
tcp_minisocks.c tcp: Fix a data-race around sysctl_tcp_rfc1337. 2022-07-29 17:14:15 +02:00
tcp_nv.c
tcp_offload.c
tcp_output.c tcp: make retransmitted SKB fit into the send window 2022-08-25 11:17:43 +02:00
tcp_rate.c tcp: ensure to use the most recently sent skb when filling the rate sample 2022-05-09 09:03:24 +02:00
tcp_recovery.c tcp: Fix data-races around sysctl_tcp_recovery. 2022-07-29 17:14:15 +02:00
tcp_scalable.c
tcp_timer.c tcp: Fix a data-race around sysctl_tcp_thin_linear_timeouts. 2022-07-29 17:14:15 +02:00
tcp_ulp.c
tcp_vegas.c
tcp_vegas.h
tcp_veno.c
tcp_westwood.c
tcp_yeah.c
tunnel4.c
udp.c udp: call udp_encap_enable for v6 sockets when enabling encap 2022-04-15 14:18:01 +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
xfrm4_protocol.c net: xfrm: unexport __init-annotated xfrm4_protocol_init() 2022-06-14 18:11:58 +02:00
xfrm4_state.c
xfrm4_tunnel.c