Skip to content

Commit 8099097

Browse files
Paolo Abenigregkh
Paolo Abeni
authored andcommitted
tcp: check mptcp-level constraints for backlog coalescing
commit 6db8a37 upstream. The MPTCP protocol can acquire the subflow-level socket lock and cause the tcp backlog usage. When inserting new skbs into the backlog, the stack will try to coalesce them. Currently, we have no check in place to ensure that such coalescing will respect the MPTCP-level DSS, and that may cause data stream corruption, as reported by Christoph. Address the issue by adding the relevant admission check for coalescing in tcp_add_backlog(). Note the issue is not easy to reproduce, as the MPTCP protocol tries hard to avoid acquiring the subflow-level socket lock. Fixes: 648ef4b ("mptcp: Implement MPTCP receive path") Cc: [email protected] Reported-by: Christoph Paasch <[email protected]> Closes: multipath-tcp/mptcp_net-next#420 Reviewed-by: Mat Martineau <[email protected]> Signed-off-by: Paolo Abeni <[email protected]> Signed-off-by: Mat Martineau <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent f7e65c0 commit 8099097

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/ipv4/tcp_ipv4.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1818,6 +1818,7 @@ bool tcp_add_backlog(struct sock *sk, struct sk_buff *skb,
18181818
#ifdef CONFIG_TLS_DEVICE
18191819
tail->decrypted != skb->decrypted ||
18201820
#endif
1821+
!mptcp_skb_can_collapse(tail, skb) ||
18211822
thtail->doff != th->doff ||
18221823
memcmp(thtail + 1, th + 1, hdrlen - sizeof(*th)))
18231824
goto no_coalesce;

0 commit comments

Comments
 (0)