]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: do not send empty skb from tcp_write_xmit()
authorEric Dumazet <edumazet@google.com>
Thu, 12 Dec 2019 20:55:29 +0000 (12:55 -0800)
committerJakub Kicinski <jakub.kicinski@netronome.com>
Sat, 14 Dec 2019 05:58:40 +0000 (21:58 -0800)
commit9d18d1763be708b2f92376266bbae56a19b0cb5b
treefe2c93adefc0440f91f6edd059f74895da12baa4
parent03c0612baee7b32e57620a7d323eac6288f6781e
tcp: do not send empty skb from tcp_write_xmit()

Backport of commit a5d73e087fb5 ("tcp: remove empty skb from
write queue in error cases") in linux-4.14 stable triggered
various bugs. One of them has been fixed in commit ba2ddb43f270
("tcp: Don't dequeue SYN/FIN-segments from write-queue"), but
we still have crashes in some occasions.

Root-cause is that when tcp_sendmsg() has allocated a fresh
skb and could not append a fragment before being blocked
in sk_stream_wait_memory(), tcp_write_xmit() might be called
and decide to send this fresh and empty skb.

Sending an empty packet is not only silly, it might have caused
many issues we had in the past with tp->packets_out being
out of sync.

Fixes: 7187a1506121 ("[TCP]: Simplify SKB data portion allocation with NETIF_F_SG.")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Christoph Paasch <cpaasch@apple.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Cc: Jason Baron <jbaron@akamai.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
net/ipv4/tcp_output.c