From nobody Mon Feb 9 08:30:57 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 88A4B36E492; Tue, 27 Jan 2026 19:27:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769542061; cv=none; b=mYenwaJ6x4QsCsH39BNDYi/Aj7YiSaLYFL1CXn5m2X2HhlZisfAwpYzFF9IXGCwb9DxcS+HXkv3+xUt18IZt8YpoMUMsye+z8yFIS1mn+FeQxv++/2V9HDeVx8jyNDVJy/lHcqwbpPYAnv44RphjejoR1jS91PIqQZz6RmkTcpg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769542061; c=relaxed/simple; bh=6TBsH+0MeO9zZb+OSXn43HSgwIckc2zzJ0HWt3vvoqc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HtbP1TJOzPO+uOKN1NetjWBRKc+HBsZVCqXNqdB2ADyB22Acv8+dJ4NOKWAwtm3iEmm2NXE3sRt+WLQT0bkMRLAKkYVr6t8vB30ga5/reB8NZ6A+YUlcPEIvGAb+xu1Zukpq/evMPo2VZV6mTHPOiC5XoKESl8kgd1uVZgkobyI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WIqNddeM; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WIqNddeM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E6695C2BC86; Tue, 27 Jan 2026 19:27:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769542061; bh=6TBsH+0MeO9zZb+OSXn43HSgwIckc2zzJ0HWt3vvoqc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=WIqNddeM/ACOkmOiPlJtEErlfxv/N4ax/MpyfMXgIC+IhB+B0jScuI2qYIud+xQSG GepujlX0F8gjwsZ498+fqZJfryHrgpFR48bhSQwq3UGZUc8i+Bw0yIYxPRqLr4B//U i6mlijdnGnaG219umF5k8uIg1iUHoED1XuMXtYTKVCh3MLyHizkIXg5m2HMw6Ojncu +7keJKvBUuiNU1VwJRtgaKyu9IImu0Q48KRdgJre4J0r+23Eg8IFuL6vln+qNMGlC2 yIqSX+cKn0MlDGLZFe0DnzkaQyqiMsZ03Yo1lDoNKaBRu1P2ex19CmhkEww3+BZ/8A 2+yMpJ58fI8zg== From: "Matthieu Baerts (NGI0)" Date: Tue, 27 Jan 2026 20:27:23 +0100 Subject: [PATCH net 1/5] mptcp: avoid dup SUB_CLOSED events after disconnect Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260127-net-mptcp-dup-nl-events-v1-1-7f71e1bc4feb@kernel.org> References: <20260127-net-mptcp-dup-nl-events-v1-0-7f71e1bc4feb@kernel.org> In-Reply-To: <20260127-net-mptcp-dup-nl-events-v1-0-7f71e1bc4feb@kernel.org> To: Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Shuah Khan Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, "Matthieu Baerts (NGI0)" , stable@vger.kernel.org, Marco Angaroni X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1804; i=matttbe@kernel.org; h=from:subject:message-id; bh=6TBsH+0MeO9zZb+OSXn43HSgwIckc2zzJ0HWt3vvoqc=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDIrBZeaa2dJ1/b2LP8cZH829rK5MVP5poCqtuWTX9vNX WC9QUamo5SFQYyLQVZMkUW6LTJ/5vMq3hIvPwuYOaxMIEMYuDgFYCJHNzH8zzzUN5dv7/tvXQ/C AzrbT+UUfurnOs+zZfn+yT18DPyzjzMynGKSuVWwMeniWZ+ZOZ6ZgtcqlYIYRB8fiWwNut/Uzna fEQA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 In case of subflow disconnect(), which can also happen with the first subflow in case of errors like timeout or reset, mptcp_subflow_ctx_reset will reset most fields from the mptcp_subflow_context structure, including close_event_done. Then, when another subflow is closed, yet another SUB_CLOSED event for the disconnected initial subflow is sent. Because of the previous reset, there are no source address and destination port. A solution is then to also check the subflow's local id: it shouldn't be negative anyway. Another solution would be not to reset subflow->close_event_done at disconnect time, but when reused. But then, probably the whole reset could be done when being reused. Let's not change this logic, similar to TCP with tcp_disconnect(). Fixes: d82809b6c5f2 ("mptcp: avoid duplicated SUB_CLOSED events") Cc: stable@vger.kernel.org Reported-by: Marco Angaroni Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/603 Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/protocol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index f505b780f713..e32ae594b4ef 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -2598,8 +2598,8 @@ void mptcp_close_ssk(struct sock *sk, struct sock *ss= k, struct mptcp_sock *msk =3D mptcp_sk(sk); struct sk_buff *skb; =20 - /* The first subflow can already be closed and still in the list */ - if (subflow->close_event_done) + /* The first subflow can already be closed or disconnected */ + if (subflow->close_event_done || READ_ONCE(subflow->local_id) < 0) return; =20 subflow->close_event_done =3D true; --=20 2.51.0 From nobody Mon Feb 9 08:30:57 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 127D536E465; Tue, 27 Jan 2026 19:27:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769542064; cv=none; b=V2MV4oiH/rAYRyvxbybr3twUx/A9F+5qtpO6cyUD1oMBOEwUWa5dTn7I+AaL8+9ZpHl8jfn3sP5CTNHp5EYGEgMff1blsrXzfbZXH9Cwr/oF46AL/tRcGWv2cfW2Q9cQ4UujOMzjbKy4PQZn48sb3vVZBeQ3uytiyR38+0ka1sc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769542064; c=relaxed/simple; bh=1Kh7LSasfGndIOTYsv93QNash+ih3iVLeARY56QPYlI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=sHk0dqiyug/2e94pdKjPKwAIcVoe7LpFpgPDb0ZY4iRR3EsfUKo7hFY9GlRphwsAtUw+lWpkPGiZ6G1ZK4H1z9BUvHXoREOlc+AUTxM+5nnkhynuIYsnJt5RdrH8tDhN73wG0YbEH9UQJorEzx6NBxlw5Vi55CjLCtaCpKfizck= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Aj5aGBbl; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Aj5aGBbl" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 91C17C116C6; Tue, 27 Jan 2026 19:27:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769542063; bh=1Kh7LSasfGndIOTYsv93QNash+ih3iVLeARY56QPYlI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Aj5aGBblXeVQ21mvcpYocBX7iYicPud/M63ZUdl0dvgCMZIH65NLD0tc75xZNbjZW cypSRdI03OjlSUQJP/aalH0VXDwQjPhPkeskp8cGj4xeLeRh5rUHDMFGgazJbcPChd RsPm62lFn+c5n/IdvESey8YWm8HKJwlU+Ny0zBhqTWaLCoZENlGN+6KQVi+JsodTDN qs803YSiV7zPtc7A9UEA5+Y2Hsp5J4ZzV2UJ6rfUhWpiE9i4sysagaMlEgtU8wA33Z ue0j7uPqPuYs2J5Bo9QhvJT+426eoxm4tIfY+5jwFZUGa8JRhddsN4Ian7uXJcEIr/ Dk0x4r7K4umqg== From: "Matthieu Baerts (NGI0)" Date: Tue, 27 Jan 2026 20:27:24 +0100 Subject: [PATCH net 2/5] selftests: mptcp: check no dup close events after error Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260127-net-mptcp-dup-nl-events-v1-2-7f71e1bc4feb@kernel.org> References: <20260127-net-mptcp-dup-nl-events-v1-0-7f71e1bc4feb@kernel.org> In-Reply-To: <20260127-net-mptcp-dup-nl-events-v1-0-7f71e1bc4feb@kernel.org> To: Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Shuah Khan Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, "Matthieu Baerts (NGI0)" , stable@vger.kernel.org X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=3543; i=matttbe@kernel.org; h=from:subject:message-id; bh=1Kh7LSasfGndIOTYsv93QNash+ih3iVLeARY56QPYlI=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDIrBZe1Loqf9GHOdHe79/uXr7vjLfRlwUnLzo1cEZkPy vbyesZydZSyMIhxMciKKbJIt0Xmz3xexVvi5WcBM4eVCWQIAxenAEzkfTUjw8mb75l2HDvNzVhf +yg9n/PerbQo9h+x8v/4p6Um//tpJsfIcEbdU9HqVqP7O6Nyg+e/rlrsT2aZ01ggVrzvznzLvdM OswEA X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 This validates the previous commit: subflow closed events are re-sent with less info when the initial subflow is disconnected after an error and each time a subflow is closed after that. In this new test, the userspace PM is involved because that's how it was discovered, but it is not specific to it. The initial subflow is terminated with a RESET, and that will cause the subflow disconnect. Then, a new subflow is initiated, but also got rejected, which cause a second subflow closed event, but not a third one. While at it, in case of failure to get the expected amount of events, the events are printed. The 'Fixes' tag here below is the same as the one from the previous commit: this patch here is not fixing anything wrong in the selftests, but it validates the previous fix for an issue introduced by this commit ID. Fixes: d82809b6c5f2 ("mptcp: avoid duplicated SUB_CLOSED events") Cc: stable@vger.kernel.org Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 51 +++++++++++++++++++++= ++++ 1 file changed, 51 insertions(+) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testin= g/selftests/net/mptcp/mptcp_join.sh index b2e6e548f796..1765714a1e2f 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3872,11 +3872,32 @@ chk_evt_nr() count=3D$(grep -cw "type:${evt}" "${evts}") if [ "${count}" !=3D "${exp}" ]; then fail_test "got ${count} events, expected ${exp}" + cat "${evts}" else print_ok fi } =20 +# $1: ns ; $2: event type ; $3: expected count +wait_event() +{ + local ns=3D"${1}" + local evt_name=3D"${2}" + local exp=3D"${3}" + + local evt=3D"${!evt_name}" + local evts=3D"${evts_ns1}" + local count + + [ "${ns}" =3D=3D "ns2" ] && evts=3D"${evts_ns2}" + + for _ in $(seq 100); do + count=3D$(grep -cw "type:${evt}" "${evts}") + [ "${count}" -ge "${exp}" ] && break + sleep 0.1 + done +} + userspace_tests() { # userspace pm type prevents add_addr @@ -4085,6 +4106,36 @@ userspace_tests() kill_events_pids mptcp_lib_kill_group_wait $tests_pid fi + + # userspace pm no duplicated spurious close events after an error + if reset_with_events "userspace pm no dup close events after error" && + continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then + set_userspace_pm $ns2 + pm_nl_set_limits $ns1 0 2 + { timeout_test=3D120 test_linkfail=3D128 speed=3Dslow \ + run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null + local tests_pid=3D$! + wait_event ns2 MPTCP_LIB_EVENT_ESTABLISHED 1 + userspace_pm_add_sf $ns2 10.0.3.2 20 + chk_mptcp_info subflows 1 subflows 1 + chk_subflows_total 2 2 + + # force quick loss + ip netns exec $ns2 sysctl -q net.ipv4.tcp_syn_retries=3D1 + if ip netns exec "${ns1}" ${iptables} -A INPUT -s "10.0.1.2" \ + -p tcp --tcp-option 30 -j REJECT --reject-with tcp-reset && + ip netns exec "${ns2}" ${iptables} -A INPUT -d "10.0.1.2" \ + -p tcp --tcp-option 30 -j REJECT --reject-with tcp-reset; then + wait_event ns2 MPTCP_LIB_EVENT_SUB_CLOSED 1 + wait_event ns1 MPTCP_LIB_EVENT_SUB_CLOSED 1 + chk_subflows_total 1 1 + userspace_pm_add_sf $ns2 10.0.1.2 0 + wait_event ns2 MPTCP_LIB_EVENT_SUB_CLOSED 2 + chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_CLOSED 2 + fi + kill_events_pids + mptcp_lib_kill_group_wait $tests_pid + fi } =20 endpoint_tests() --=20 2.51.0 From nobody Mon Feb 9 08:30:57 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A15C236EAAE; Tue, 27 Jan 2026 19:27:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769542066; cv=none; b=j1UxLIMR4V1bH1NS18x2+PTDY1Nv5d3RdcX2GT2ICUzzns+MC/3bnCDMQe2FEZhFEaUXJYpNhjEVOlz3Pu0VguCt9DmIPXPtQDXn40m4fFVT6ggZYix3neMInBS7dwofKqgt17AhkcLHkumm9VBlVtx7pP/wo9XfXHmiYQy9L1o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769542066; c=relaxed/simple; bh=aw/CHZDe8DyoCTO7QmyWPlYRdrEo0GFEKZQuPAfPWn8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fPx6rykIZeDGlZkYCnQA0eJE/9J+azZWNNUJLG+CQqVVAqdGAZHhnr4glOFVG9fh07DzbU5W0S8fWG3rg5kzVrR2XmCKjLNTwWtMtfh0OvPljgw3gH+p/l2/sc737hQful4+SGF5zSQ9kgr1knYw4IB7b2GfZtp8aKWlmggn1PU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lyNdXxPW; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lyNdXxPW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 19FF6C19425; Tue, 27 Jan 2026 19:27:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769542066; bh=aw/CHZDe8DyoCTO7QmyWPlYRdrEo0GFEKZQuPAfPWn8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=lyNdXxPWU4xmaLLPDx+yPFWBDrE3O/T9xJhS6c7kmEB3NuvRE54Uz1vy0VVRxSKRv c2ytRdDCPHFnCI/ndwlFcAYI7K/pJkUscKf2vufFfBdPa5JP1EJUrwTLm595+uaPLJ jvjxjNLVICdu9wtxOfmGg95OIo4LJsA3eEMQDY5VibTmpVFXekjdWwfERpxQsfFLh/ HDzmMxOqtZCabMF/Gzk8l6cGoJ9eM+8rL23w/jQzHZmF8SgmADatwMAUT5r6uh8hcQ h2Auw+P8oIyENmpeuOpYwL31Igk/q1HMrYGy9W8Marn/lNrcwimM29cm/H4MItZ+qW 6Kfc+Y+9M0sbQ== From: "Matthieu Baerts (NGI0)" Date: Tue, 27 Jan 2026 20:27:25 +0100 Subject: [PATCH net 3/5] mptcp: only reset subflow errors when propagated Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260127-net-mptcp-dup-nl-events-v1-3-7f71e1bc4feb@kernel.org> References: <20260127-net-mptcp-dup-nl-events-v1-0-7f71e1bc4feb@kernel.org> In-Reply-To: <20260127-net-mptcp-dup-nl-events-v1-0-7f71e1bc4feb@kernel.org> To: Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Shuah Khan Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, "Matthieu Baerts (NGI0)" , stable@vger.kernel.org X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1737; i=matttbe@kernel.org; h=from:subject:message-id; bh=aw/CHZDe8DyoCTO7QmyWPlYRdrEo0GFEKZQuPAfPWn8=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDIrBZf17v7w+tAbO5XTuurbuo65FcWZbVh1wUM+567+l jtBQk41HaUsDGJcDLJiiizSbZH5M59X8ZZ4+VnAzGFlAhnCwMUpABPJLWZkuPf0LkvGtl0L/l2d rTr31hwzSYW4tISjrEYnPh/I+v8pmZfhf4664bwYTWEp60ynjkzDtqM5uqvY6mNqz82cEMW+zmQ KPwA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 Some subflow socket errors need to be reported to the MPTCP socket: the initial subflow connect (MP_CAPABLE), and the ones from the fallback sockets. The others are not propagated. The issue is that sock_error() was used to retrieve the error, which was also resetting the sk_err field. Because of that, when notifying the userspace about subflow close events later on from the MPTCP worker, the ssk->sk_err field was always 0. Now, the error (sk_err) is only reset when propagating it to the msk. Fixes: 15cc10453398 ("mptcp: deliver ssk errors to msk") Cc: stable@vger.kernel.org Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/protocol.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index e32ae594b4ef..8d3233667418 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -821,11 +821,8 @@ static bool __mptcp_ofo_queue(struct mptcp_sock *msk) =20 static bool __mptcp_subflow_error_report(struct sock *sk, struct sock *ssk) { - int err =3D sock_error(ssk); int ssk_state; - - if (!err) - return false; + int err; =20 /* only propagate errors on fallen-back sockets or * on MPC connect @@ -833,6 +830,10 @@ static bool __mptcp_subflow_error_report(struct sock *= sk, struct sock *ssk) if (sk->sk_state !=3D TCP_SYN_SENT && !__mptcp_check_fallback(mptcp_sk(sk= ))) return false; =20 + err =3D sock_error(ssk); + if (!err) + return false; + /* We need to propagate only transition to CLOSE state. * Orphaned socket will see such state change via * subflow_sched_work_if_closed() and that path will properly --=20 2.51.0 From nobody Mon Feb 9 08:30:57 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1A57D371068; Tue, 27 Jan 2026 19:27:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769542069; cv=none; b=C0ABTDKk3pSOvOYdh6RGRT/wvUPym2fhsEaDSPSjWU0yFg9blJP12ASqvToHqAExEoURrpZ4Br2bRjOMMVTd5g7je9gElycbQsFahsF1+qjv/wg6mMN9dCyg5WcmhrlX4szigBefXfuC2LGHY/SbcSHRJR6d62V3XHR2u0OI2vs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769542069; c=relaxed/simple; bh=YWZ4ix1ch5qlLuSWWbNRRB4AMzc3t2vkQ0rmfUvdMo0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GMgfhX/fenyz5rgPhavB4ifYr61jlSEf8dXQG15sndQ3na8Ui3dYnEf42IBelwRgGCivvPXfSkXumOWFpbUjDd61+qpncmyJfgyGq9Q84pEECaQ6cquB4WLLvMbureicZIZtxh0V4GMCpADtNUUmrLVgmttWyrqUAWt27yskUk8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=szfTpObo; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="szfTpObo" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9648CC116C6; Tue, 27 Jan 2026 19:27:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769542068; bh=YWZ4ix1ch5qlLuSWWbNRRB4AMzc3t2vkQ0rmfUvdMo0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=szfTpOboUfJWOHlZcHnbxz0OhgcZEuMPpOl6s1H1HPdFIp0BveXba9y+ggpzyRhrJ rjHoaCuIFYFSUltPebBtL8CJtoFScroTAKaBSE/ClqzzOpr0SgK0HI9GAA3ZEOq1KU URhiaE3HVQ6jDXwSIfT7U+OtBTj+VwrGaVCA8qG6gT/wTciTBTaidx4+9zIbfj4tsm LYNuklkYSLb/O8p3nAVGCG8axJjKSlDZNEnK2JsiFmmJWZ/uqEyxfVLyfsxcO5D9uD L4IKh7Avz4tVNz0N3mV15U+zRvZDdQnuP7Oq8IkwcULnbuKBRfqMCcIDl7ZGKOHH4s SFMlhshg+Zsgw== From: "Matthieu Baerts (NGI0)" Date: Tue, 27 Jan 2026 20:27:26 +0100 Subject: [PATCH net 4/5] selftests: mptcp: check subflow errors in close events Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260127-net-mptcp-dup-nl-events-v1-4-7f71e1bc4feb@kernel.org> References: <20260127-net-mptcp-dup-nl-events-v1-0-7f71e1bc4feb@kernel.org> In-Reply-To: <20260127-net-mptcp-dup-nl-events-v1-0-7f71e1bc4feb@kernel.org> To: Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Shuah Khan Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, "Matthieu Baerts (NGI0)" , stable@vger.kernel.org X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2760; i=matttbe@kernel.org; h=from:subject:message-id; bh=YWZ4ix1ch5qlLuSWWbNRRB4AMzc3t2vkQ0rmfUvdMo0=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDIrBZcXf331L8B469Rqh+akg4LnlGy4XMxtls3dYKZVI rbqbfeFjlIWBjEuBlkxRRbptsj8mc+reEu8/Cxg5rAygQxh4OIUgIlcM2f4H7+37WS+oE6JSOrV zVtWz3+1tq5qMlPbTeF5vWwTeOqZjjMyTPP23bfDjeONcnvq2qsO4gmXfhQwdob6Tq2//WNa9fQ cHgA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 This validates the previous commit: subflow closed events should contain an error field when a subflow got closed with an error, e.g. reset or timeout. For this test, the chk_evt_nr helper has been extended to check attributes in the matched events. In this test, the 2 subflow closed events should have an error. The 'Fixes' tag here below is the same as the one from the previous commit: this patch here is not fixing anything wrong in the selftests, but it validates the previous fix for an issue introduced by this commit ID. Fixes: 15cc10453398 ("mptcp: deliver ssk errors to msk") Cc: stable@vger.kernel.org Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 23 ++++++++++++++++++++-= -- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testin= g/selftests/net/mptcp/mptcp_join.sh index 1765714a1e2f..3fc29201362a 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3847,21 +3847,28 @@ userspace_pm_chk_get_addr() fi } =20 -# $1: ns ; $2: event type ; $3: count +# $1: ns ; $2: event type ; $3: count ; [ $4: attr ; $5: attr count ] chk_evt_nr() { local ns=3D${1} local evt_name=3D"${2}" local exp=3D"${3}" + local attr=3D"${4}" + local attr_exp=3D"${5}" =20 local evts=3D"${evts_ns1}" local evt=3D"${!evt_name}" + local attr_name local count =20 + if [ -n "${attr}" ]; then + attr_name=3D", ${attr}: ${attr_exp}" + fi + evt_name=3D"${evt_name:16}" # without MPTCP_LIB_EVENT_ [ "${ns}" =3D=3D "ns2" ] && evts=3D"${evts_ns2}" =20 - print_check "event ${ns} ${evt_name} (${exp})" + print_check "event ${ns} ${evt_name} (${exp}${attr_name})" =20 if [[ "${evt_name}" =3D "LISTENER_"* ]] && ! mptcp_lib_kallsyms_has "mptcp_event_pm_listener$"; then @@ -3873,6 +3880,16 @@ chk_evt_nr() if [ "${count}" !=3D "${exp}" ]; then fail_test "got ${count} events, expected ${exp}" cat "${evts}" + return + elif [ -z "${attr}" ]; then + print_ok + return + fi + + count=3D$(grep -w "type:${evt}" "${evts}" | grep -c ",${attr}:") + if [ "${count}" !=3D "${attr_exp}" ]; then + fail_test "got ${count} event attributes, expected ${attr_exp}" + grep -w "type:${evt}" "${evts}" else print_ok fi @@ -4131,7 +4148,7 @@ userspace_tests() chk_subflows_total 1 1 userspace_pm_add_sf $ns2 10.0.1.2 0 wait_event ns2 MPTCP_LIB_EVENT_SUB_CLOSED 2 - chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_CLOSED 2 + chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_CLOSED 2 error 2 fi kill_events_pids mptcp_lib_kill_group_wait $tests_pid --=20 2.51.0 From nobody Mon Feb 9 08:30:57 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9FB90371046; Tue, 27 Jan 2026 19:27:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769542071; cv=none; b=ZzxF5vfUpvu4isy4V9+5mzqigu+aDhg8ykJEIR6WtYPCf99mmIWvc0mwiCTbV6sXwlN1+V92tlMmBOGesTtOyYAYRkEMynbVnJt8+vOr81sWsbRu9hSzTW71O8G40GKJP6780U9iW8spMozg46ZHRmimDQMKGQO4hot59YM+bgs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769542071; c=relaxed/simple; bh=ytjJ25Q1jmwXE29IQbjqiVL3coToMRadyXhmXWtjND8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=REbOz8ytgi10EedfoAEMhlYKYROnz5ZfYZphu0d3tBu/RANE6uCV+N2hmhKHuozBRX31lfZ53Ok+qOT8Zd5PujYaAhy4hExCKuGDoRUwRO7lNulZhmktJvWmQ+1bcoKWe4BVQ9/4W99kruxEz76siUs5G+Ht7MfnoOFNQPFA8ZU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=UnNTQJto; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="UnNTQJto" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1E283C19425; Tue, 27 Jan 2026 19:27:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769542071; bh=ytjJ25Q1jmwXE29IQbjqiVL3coToMRadyXhmXWtjND8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=UnNTQJtoSVqy9mLMLJ2g0son1lXJ7iQ8GevQnsC3V6Ny+XKz5OWLiv+ewt8gilpth 13b61T3CgpcvbizoZAQ7OIzB4o2dR/WXGgK5UP6bshYgCyVluTBShM1udB0RIUtZbF /pV2vILb0FgWu4a/QREO7y9D21mgs9tg1hZssRqPM/wvhBnbM1nvj0vg9JQdCHWBM6 lEPOVPPNcyusNnqxU951RnQDcct4tLMpE4sHZWdjIVh3FOYhOTR+8L0I84kcCj3kpL ENQLW7mVAQ0mPaojxEXbpZfzNqNc+JvduiZAhZIN00+gMo0QaRfMTUQehXkycBDTxU IbepUWMs5717g== From: "Matthieu Baerts (NGI0)" Date: Tue, 27 Jan 2026 20:27:27 +0100 Subject: [PATCH net 5/5] selftests: mptcp: join: fix local endp not being tracked Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260127-net-mptcp-dup-nl-events-v1-5-7f71e1bc4feb@kernel.org> References: <20260127-net-mptcp-dup-nl-events-v1-0-7f71e1bc4feb@kernel.org> In-Reply-To: <20260127-net-mptcp-dup-nl-events-v1-0-7f71e1bc4feb@kernel.org> To: Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Shuah Khan Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, "Matthieu Baerts (NGI0)" , stable@vger.kernel.org X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2148; i=matttbe@kernel.org; h=from:subject:message-id; bh=ytjJ25Q1jmwXE29IQbjqiVL3coToMRadyXhmXWtjND8=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDIrBZfnbsn02dD+KTqoor5G+3r8av1V/x+o9E2Y47q0t 8W88/nPjlIWBjEuBlkxRRbptsj8mc+reEu8/Cxg5rAygQxh4OIUgImUX2P4w+uzxCLT70JehuLU FD2btzN8167r36puLmi7/ormd4VN5owMewzurdFKddtles1kth8D0+rpP87N5GaXTJHJ3xdkUX6 dBQA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 When running this mptcp_join.sh selftest on older kernel versions not supporting local endpoints tracking, this test fails because 3 MP_JOIN ACKs have been received, while only 2 were expected. It is not clear why only 2 MP_JOIN ACKs were expected on old kernel versions, while 3 MP_JOIN SYN and SYN+ACK were expected. When testing on the v5.15.197 kernel, 3 MP_JOIN ACKs are seen, which is also what is expected in the selftests included in this kernel version, see commit f4480eaad489 ("selftests: mptcp: add missing join check"). Switch the expected MP_JOIN ACKs to 3. While at it, move this chk_join_nr helper out of the special condition for older kernel versions as it is now the same as with more recent ones. Also, invert the condition to be more logical: what's expected on newer kernel versions having such helper first. Fixes: d4c81bbb8600 ("selftests: mptcp: join: support local endpoint being = tracked or not") Cc: stable@vger.kernel.org Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testin= g/selftests/net/mptcp/mptcp_join.sh index 3fc29201362a..e70d3420954f 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -2329,17 +2329,16 @@ signal_address_tests() ip netns exec $ns1 sysctl -q net.mptcp.add_addr_timeout=3D1 speed=3Dslow \ run_tests $ns1 $ns2 10.0.1.1 + chk_join_nr 3 3 3 =20 # It is not directly linked to the commit introducing this # symbol but for the parent one which is linked anyway. - if ! mptcp_lib_kallsyms_has "mptcp_pm_subflow_check_next$"; then - chk_join_nr 3 3 2 - chk_add_nr 4 4 - else - chk_join_nr 3 3 3 + if mptcp_lib_kallsyms_has "mptcp_pm_subflow_check_next$"; then # the server will not signal the address terminating # the MPC subflow chk_add_nr 3 3 + else + chk_add_nr 4 4 fi fi } --=20 2.51.0