]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: add missing tcp_skb_can_collapse() test in tcp_shift_skb_data()
authorEric Dumazet <edumazet@google.com>
Tue, 1 Feb 2022 18:46:40 +0000 (10:46 -0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 3 Feb 2022 00:22:37 +0000 (16:22 -0800)
commit489e57ef8d09157af28ea67cbaa69e82976d0cfc
tree68457fa31da2ea88566fab29049f5565aed425b7
parent488ec40a33194d94d7fd0e9f5040e4eb363757ee
tcp: add missing tcp_skb_can_collapse() test in tcp_shift_skb_data()

tcp_shift_skb_data() might collapse three packets into a larger one.

P_A, P_B, P_C  -> P_ABC

Historically, it used a single tcp_skb_can_collapse_to(P_A) call,
because it was enough.

In commit 14eef5fc01e2 ("tcp: coalesce/collapse must respect MPTCP extensions"),
this call was replaced by a call to tcp_skb_can_collapse(P_A, P_B)

But the now needed test over P_C has been missed.

This probably broke MPTCP.

Then later, commit 402623a4cc78 ("net: avoid double accounting for pure zerocopy skbs")
added an extra condition to tcp_skb_can_collapse(), but the missing call
from tcp_shift_skb_data() is also breaking TCP zerocopy, because P_A and P_C
might have different skb_zcopy_pure() status.

Fixes: 14eef5fc01e2 ("tcp: coalesce/collapse must respect MPTCP extensions")
Fixes: 402623a4cc78 ("net: avoid double accounting for pure zerocopy skbs")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Mat Martineau <mathew.j.martineau@linux.intel.com>
Cc: Talal Ahmad <talalahmad@google.com>
Cc: Arjun Roy <arjunroy@google.com>
Cc: Willem de Bruijn <willemb@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Link: https://lore.kernel.org/r/20220201184640.756716-1-eric.dumazet@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/tcp_input.c