Commit 8d8739a8 authored by Paolo Abeni's avatar Paolo Abeni Committed by Wentao Guan
Browse files

mptcp: prevent excessive coalescing on receive

stable inclusion
from stable-v6.6.78
commit a772014594644de89f309a65c1a4308ff1fde6f4
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IBX1M5

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=a772014594644de89f309a65c1a4308ff1fde6f4



--------------------------------

commit 56b824eb49d6258aa0bad09a406ceac3f643cdae upstream.

Currently the skb size after coalescing is only limited by the skb
layout (the skb must not carry frag_list). A single coalesced skb
covering several MSS can potentially fill completely the receive
buffer. In such a case, the snd win will zero until the receive buffer
will be empty again, affecting tput badly.

Fixes: 8268ed4c ("mptcp: introduce and use mptcp_try_coalesce()")
Cc: stable@vger.kernel.org # please delay 2 weeks after 6.13-final release
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
Reviewed-by: default avatarMat Martineau <martineau@kernel.org>
Signed-off-by: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20241230-net-mptcp-rbuf-fixes-v1-3-8608af434ceb@kernel.org


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit a772014594644de89f309a65c1a4308ff1fde6f4)
Signed-off-by: default avatarWentao Guan <guanwentao@uniontech.com>
parent 90e7b20f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -135,6 +135,7 @@ static bool mptcp_try_coalesce(struct sock *sk, struct sk_buff *to,
	int delta;

	if (MPTCP_SKB_CB(from)->offset ||
	    ((to->len + from->len) > (sk->sk_rcvbuf >> 3)) ||
	    !skb_try_coalesce(to, from, &fragstolen, &delta))
		return false;