From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796333545; b=g5qBgcbPPKMHxAZu7WxN6V3yl1wgfyxftkkLBuMwO9EiELA2v1uYIzDJPbUlV7hkCf69 PuVSLsvGub6rQf31CTwWoUBHsadU3PlOOcHBLfBNhGgmlMYIJYyAR6oEzIYxZMHNVvwSr aNZUpI3qRzd2zPpXdXT8swTUbVkPnsdpBItHPiy2VtXnj0dCPpcIy428FBPapuPUIXTRF 18/SzwKQaHN+NdR+MnBj6d4+1r6Wb/JODWqK1pnW0OlydqLQbbz79e/vbrhrsjTHAmn68 iIegs6SX77EopJ+tC1M5splyjuZxtZ58J2X2VlWFxk7l6tPW9+K0zL9b7H38o1fLzCQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796333545; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=qcWfj+KsJPgUuKN2Ebf7dHPHUfmFq3D7JDA41kBiaGs=; b=eaLqdEdK0+ToyHGRjmkWc+MOE+ZPDOcq3K1O+OVQPNQ2J0Qfg/YwTrBbH2uuJ2Euusp9 h9Fn5zInRhAb4YmMq9IyTbwuAZDYEnjMFyt1IYaJKpMO4bUIRepwEX8ye3WUl3URe4ndo zXME+mGRFJyw94UmU9dxmhCHf8ZGhf1cUtrgL0KR6C4w9LfZLT3EmX+7sUsX4/a6Cl2EJ RAzihnGxvhGk1zOAdPsngJyYE9vUyQ6Y2X2H+dmutgztnIvRvKinYRZW3MzvSFvRU/mJ0 hrEruUrFBi0GMGOH0XKcezYv54TUGlsM2lxdd7cJWGPME+uFeBDculQAidFBIC7h/Rw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=FnUdWsNV; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E4C88606A322 for ; Thu, 3 Dec 2026 21:32:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=FnUdWsNV Received: by smtp.kernel.org (Postfix) with ESMTPSA id ADCC01F000C2; Thu, 3 Dec 2026 21:32:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796333544; bh=qcWfj+KsJPgUuKN2Ebf7dHPHUfmFq3D7JDA41kBiaGs=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=FnUdWsNVIsd5h5yYVz/JBJMzfsf+zZG8i//UjW6e2NqzoI3uK/88XQz2dtQvw1ewn bwwKtOmqmNfXJPmOiBKYpxnlxdGZZKlru8Oc+YEW7/822aNLFJRCCgcSqgpqkf2Zfz BVdcDt1zpQp3GU761gLV1nWK/R/KNRULavkcb0l8HKC5syO/5+0j/vt/HJqE4uxIr8 HgCV62H6EGcAsnW9PVhJafdP98U9EI7TxW+Kp4y7dl+XHZ732OsBxbFIhn+VSAxzw1 MukiYl6jGKGrdvvXqqRjD8XUEqUMYgA9KI045cum/UQCEgDzauXTS2LUoA7xemvNCN C48nequFdc95A== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH net 4/9] mptcp: count orphans as TCP does Reply-To: sashiko-reviews@lists.linux.dev To: =?utf-8?b?TWF0dGhpZXUgQmFlcnRzIChOR0kwKQ==?= Cc: mptcp@lists.linux.dev In-Reply-To: <20261202-net-mptcp-misc-fixes-7-4-rc7-v1-4-9f03efcb1a17@kernel.org> References: <20261202-net-mptcp-misc-fixes-7-4-rc7-v1-0-9f03efcb1a17@kernel.org> <20261202-net-mptcp-misc-fixes-7-4-rc7-v1-4-9f03efcb1a17@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 21:32:24 +0000 X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] mptcp: mptcp_do_fastclose() skips subflow reset on OOM in __mptcp_close() on fallback -- commit 4377538120d3ad1120ff0509815bfb16596430d5 Author: Matthieu Baerts (NGI0) mptcp: count orphans as TCP does This commit accounts for orphaned MPTCP sockets in tcp_orphan_count and resets them via mptcp_orphan_oom() when orphan or TCP memory limits are exceeded at close() or after the close timeout expires. > diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c > index 96b3baef341f3..fc8aad7e2fde9 100644 > --- a/net/mptcp/protocol.c > +++ b/net/mptcp/protocol.c [ ... ] > @@ -3579,8 +3592,15 @@ bool __mptcp_close(struct sock *sk, long timeout) > /* all the subflows are closed, only timeout can change the msk > * state, let's not keep resources busy for no reasons > */ > - if (subflows_alive =3D=3D 0) > + if (subflows_alive =3D=3D 0) { > mptcp_set_state(sk, TCP_CLOSE); > + } else if (sk->sk_state !=3D TCP_CLOSE) { > + /* as TCP orphans: counted, and limited */ > + tcp_orphan_count_inc(); > + set_bit(MPTCP_ORPHAN_COUNTED, &msk->flags); > + if (mptcp_orphan_oom(sk)) > + mptcp_do_fastclose(sk); > + } [Severity: Medium] Does calling mptcp_do_fastclose() here fail to reset the subflow when mptcp_orphan_oom() triggers on a fallback socket? On a fallback socket, mptcp_do_fastclose() sets sk->sk_state to TCP_CLOSE and msk->fastclosing =3D 1, then returns early without resetting ssk or setting subflow->send_fastclose: net/mptcp/protocol.c:mptcp_do_fastclose() { mptcp_set_state(sk, TCP_CLOSE); mptcp_backlog_purge(sk); msk->fastclosing =3D 1; /* Explicitly send the fastclose reset as need */ if (__mptcp_check_fallback(msk)) return; ... } Because sk->sk_state is now TCP_CLOSE, __mptcp_close() immediately calls __mptcp_destroy_sock() -> mptcp_destroy(), which sets msk->free_first =3D 1 and runs __mptcp_clear_xmit() and __mptcp_close_ssk(). With msk->free_first set and subflow->send_fastclose unset, __mptcp_close_ssk() skips __mptcp_subflow_disconnect() and calls __tcp_close(ssk, 0) on the still-open subflow. If msk->rtx_queue had unpushed data, __mptcp_clear_xmit() discards it before __tcp_close(ssk, 0) sends a clean TCP FIN after the truncated stream (leaving ssk alive in TCP_FIN_WAIT1 if freeing msk->rtx_queue relieved the memory pressure), or __tcp_close(ssk, 0) hits tcp_check_oom() again and double-increments LINUX_MIB_TCPABORTONMEMORY. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202-net-mptcp-= misc-fixes-7-4-rc7-v1-0-9f03efcb1a17@kernel.org?part=3D4