From nobody Mon Mar 2 06:41:56 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 0EA1727707; Wed, 11 Feb 2026 19:06:54 +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=1770836814; cv=none; b=OFFNoCYJdG53sVCLZxQRA6XkIyTW7Z8MVkUi04hy0n2TxAFIh0APpCraNBhBjeYhejEgkSSN3139j7MOsjzjdGeC3G6SdKe7D7C5/SDo1vd0tdxg+XTyKYVyPq0nFozQB3alGrJemb2weV35/0HjdhAcKJwU8y1a6/fSdH75EG4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770836814; c=relaxed/simple; bh=yZKbun0UE2n4F4z+yVDxFjjvJUMEnSXooO5JyqQFnHk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BvLnAFL4NYmjtwqWfy5Gm8H5SLXas5y9zD0G59YKNhLaQs8esmZeZ3eFOmlm4YS0CLW2jw+5wko5+Jej/SkzFrBTLMn5OFwNOFfwGLiQPsPjGyPCjoU4l7v130tVnGtutwzldyzcq35AElPm9fNj+MK2kfuUIfu9M0gtjle2P9k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rxqhv+1S; 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="rxqhv+1S" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93459C2BC86; Wed, 11 Feb 2026 19:06:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770836813; bh=yZKbun0UE2n4F4z+yVDxFjjvJUMEnSXooO5JyqQFnHk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rxqhv+1SVp8XJUtqd9O3hQ/TJ1FQ5T2W2klxOHJDhJbE5hkvte/2rqo0bShCWU4CI 5emqMnPurdRUMGembGhnzMjJlNx8gL/oCtRW91Fy0TdMwzTkghHARn3dUS5j8WHDRf Eov+JeDQMPt6nqZUCx+RVvGfFcLDdr0ExoJlu70Om3/hNs4SpilsDTTig2XiSvqxxj +hXFOj3lS+hmHEuVX5EchAImv1uLeS1LLdcko4tHRC9bCLZMrYU6HkAwNhW2E20JsS Eiw289WcsACuvMM6/nYckTK3gzKgBOSj4q7dEbC6a8nFHo4dc9ztZNnGeU63x2bc2X KsPxb9jqmR4fQ== From: "Matthieu Baerts (NGI0)" To: mptcp@lists.linux.dev, stable@vger.kernel.org, gregkh@linuxfoundation.org Cc: "Matthieu Baerts (NGI0)" , sashal@kernel.org, Mat Martineau , Jakub Kicinski Subject: [PATCH 6.1.y 1/6] selftests: mptcp: pm: ensure unknown flags are ignored Date: Wed, 11 Feb 2026 20:06:19 +0100 Message-ID: <20260211190617.77192-9-matttbe@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260211190617.77192-8-matttbe@kernel.org> References: <20260211190617.77192-8-matttbe@kernel.org> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3623; i=matttbe@kernel.org; h=from:subject; bh=yZKbun0UE2n4F4z+yVDxFjjvJUMEnSXooO5JyqQFnHk=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDJ7LusEBW0Rv7g/WMKdm3vVIQ8X53hxgzOB6pMcWsVPn 2ETMajsKGVhEONikBVTZJFui8yf+byKt8TLzwJmDisTyBAGLk4BmEhRBCPDoU9/Z9WlaN9fETk9 if3RBu3g8E+/3kj7fs3MC3US3DfFipHhqV/RavN4/6ZJSw/Jz+FRPziz7wTjDQ4B/1bvN6qOhfn cAA== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" commit 29f4801e9c8dfd12bdcb33b61a6ac479c7162bd7 upstream. This validates the previous commit: the userspace can set unknown flags -- the 7th bit is currently unused -- without errors, but only the supported ones are printed in the endpoints dumps. 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: 01cacb00b35c ("mptcp: add netlink-based PM") Cc: stable@vger.kernel.org Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts (NGI0) Link: https://patch.msgid.link/20251205-net-mptcp-misc-fixes-6-19-rc1-v1-2-= 9e4781a6c1b8@kernel.org Signed-off-by: Jakub Kicinski [ Conflicts in pm_netlink.sh, because some refactoring have been done later on: commit 0d16ed0c2e74 ("selftests: mptcp: add {get,format}_endpoint(s) helpers") and commit c99d57d0007a ("selftests: mptcp: use pm_nl endpoint ops") are not in this version. The same operation can still be done at the same place, without using the new helpers. Also, commit 1dc88d241f92 ("selftests: mptcp: pm_nl_ctl: always look for errors") is not in this version, and create a conflict in the context which is not related to the modification here. ] Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/pm_netlink.sh | 4 ++++ tools/testing/selftests/net/mptcp/pm_nl_ctl.c | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/tools/testing/selftests/net/mptcp/pm_netlink.sh b/tools/testin= g/selftests/net/mptcp/pm_netlink.sh index 1b0ed849c617..4dfb6b93d9cb 100755 --- a/tools/testing/selftests/net/mptcp/pm_netlink.sh +++ b/tools/testing/selftests/net/mptcp/pm_netlink.sh @@ -124,6 +124,10 @@ id 8 flags signal 10.0.1.8" "id limit" ip netns exec $ns1 ./pm_nl_ctl flush check "ip netns exec $ns1 ./pm_nl_ctl dump" "" "flush addrs" =20 +ip netns exec $ns1 ./pm_nl_ctl add 10.0.1.1 flags unknown +check "ip netns exec $ns1 ./pm_nl_ctl dump" "id 1 flags 10.0.1.1" "ignore= unknown flags" +ip netns exec $ns1 ./pm_nl_ctl flush + ip netns exec $ns1 ./pm_nl_ctl limits 9 1 check "ip netns exec $ns1 ./pm_nl_ctl limits" "$default_limits" "rcv addrs= above hard limit" =20 diff --git a/tools/testing/selftests/net/mptcp/pm_nl_ctl.c b/tools/testing/= selftests/net/mptcp/pm_nl_ctl.c index 17e5b7ec53b6..5feecb3463a1 100644 --- a/tools/testing/selftests/net/mptcp/pm_nl_ctl.c +++ b/tools/testing/selftests/net/mptcp/pm_nl_ctl.c @@ -29,6 +29,8 @@ #define IPPROTO_MPTCP 262 #endif =20 +#define MPTCP_PM_ADDR_FLAG_UNKNOWN _BITUL(7) + static void syntax(char *argv[]) { fprintf(stderr, "%s add|ann|rem|csf|dsf|get|set|del|flush|dump|events|lis= ten|accept []\n", argv[0]); @@ -814,6 +816,8 @@ int add_addr(int fd, int pm_family, int argc, char *arg= v[]) flags |=3D MPTCP_PM_ADDR_FLAG_BACKUP; else if (!strcmp(tok, "fullmesh")) flags |=3D MPTCP_PM_ADDR_FLAG_FULLMESH; + else if (!strcmp(tok, "unknown")) + flags |=3D MPTCP_PM_ADDR_FLAG_UNKNOWN; else error(1, errno, "unknown flag %s", argv[arg]); @@ -1019,6 +1023,13 @@ static void print_addr(struct rtattr *attrs, int len) printf(","); } =20 + if (flags & MPTCP_PM_ADDR_FLAG_UNKNOWN) { + printf("unknown"); + flags &=3D ~MPTCP_PM_ADDR_FLAG_UNKNOWN; + if (flags) + printf(","); + } + /* bump unknown flags, if any */ if (flags) printf("0x%x", flags); --=20 2.51.0 From nobody Mon Mar 2 06:41:56 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 13482346ADC; Wed, 11 Feb 2026 19:06:57 +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=1770836818; cv=none; b=R+n/bX7hvxblIMQrfZXSJJck3+IoLA/crxjmqOgnswJZiWNJ05qco/veajulBvIG71RWQtkiaHhz67bANw3lKd0OroQgC9O1KxikzIEXIKk1063bbKtJMeLQU1C8fZ91epxLMDreaIVPcSR3xSUmQiR2NFK1hNW5Dc9g5/zuSzI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770836818; c=relaxed/simple; bh=1yOQN7PQEIRho9X34GhsEwbRNe8punC0i6d/rfJQc50=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=f6s8jNelF0VLllMcVsEE9HkFC0nWnJiA/t58xFR8fGuNf5f4pOaXWHU18jNIZJws1PEOB0q21ivlVXlEs7bsTWidycvW2aFEhAfj6BJXmjTtabYr7oIxeN4WgCJaSMIRTnPjwjURySbeD8LonVhrxG1ROlB4AfqHykuj1zVcO8E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=E9YvCkob; 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="E9YvCkob" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4FB08C2BCB1; Wed, 11 Feb 2026 19:06:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770836817; bh=1yOQN7PQEIRho9X34GhsEwbRNe8punC0i6d/rfJQc50=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E9YvCkobBCZSo7aJFrSPN3thw+0XHfJNWyi/Empp7b3sP0IJlaRn+bojUbZYPNwiK QBol6/9QPogue4V/QUooWwIB5wxsBYlME/LgCYxMg92K40buzb4zZ486H+WtEeLLHE 5uONcNldHPW2XIxfmqKZN6FP/SJxpdDRQERIiYgnDX4RCVFA3ut8whKSqjX16j7F0K KxBC7pmBKQTXb4emJZpDlTuLU2YqgPCYhN6ScRHQbGD6NZEuQdA5BMhNnDquVesB7B L6j9kBDMjGg/839hbdhWvXU8I0aBfI5SATl8dif7Ya/ZwCfqEtgbKHYoT47BFr8wjW 8Z6IwqYFf6ubQ== From: "Matthieu Baerts (NGI0)" To: mptcp@lists.linux.dev, stable@vger.kernel.org, gregkh@linuxfoundation.org Cc: Paolo Abeni , sashal@kernel.org, "Matthieu Baerts (NGI0)" , Jakub Kicinski Subject: [PATCH 6.1.y 2/6] mptcp: schedule rtx timer only after pushing data Date: Wed, 11 Feb 2026 20:06:20 +0100 Message-ID: <20260211190617.77192-10-matttbe@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260211190617.77192-8-matttbe@kernel.org> References: <20260211190617.77192-8-matttbe@kernel.org> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2549; i=matttbe@kernel.org; h=from:subject; bh=32qO1VArjJDOXlEbLM+G54M2ILeFc+41VELU3gX5Al8=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDJ7LuuK1jKLi2/YKvO4uCvTd43dbu9tp3gPij4Kl1DwT SuS2x7SUcrCIMbFICumyCLdFpk/83kVb4mXnwXMHFYmkCEMXJwCMJE7ZowMZ+3nWxZs79BlKV9m s8a0/MjELT6VS1oEL2k+ElniU1FXyciwaJ8z41Nb7UAG55V55+9Unc7PqPl16+LPZTzMvvtul01 nBgA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Paolo Abeni commit 2ea6190f42d0416a4310e60a7fcb0b49fcbbd4fb upstream. The MPTCP protocol usually schedule the retransmission timer only when there is some chances for such retransmissions to happen. With a notable exception: __mptcp_push_pending() currently schedule such timer unconditionally, potentially leading to unnecessary rtx timer expiration. The issue is present since the blamed commit below but become easily reproducible after commit 27b0e701d387 ("mptcp: drop bogus optimization in __mptcp_check_push()") Fixes: 33d41c9cd74c ("mptcp: more accurate timeout") Cc: stable@vger.kernel.org Signed-off-by: Paolo Abeni Reviewed-by: Matthieu Baerts (NGI0) Signed-off-by: Matthieu Baerts (NGI0) Link: https://patch.msgid.link/20251205-net-mptcp-misc-fixes-6-19-rc1-v1-3-= 9e4781a6c1b8@kernel.org Signed-off-by: Jakub Kicinski [ Conflicts in protocol.c, because commit 0fa1b3783a17 ("mptcp: use get_send wrapper") is not in this version, and is changing the context. The same modification can still be applied. ] Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/protocol.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 2d107a1f2ef9..ad0bfdd308be 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -1666,7 +1666,7 @@ void __mptcp_push_pending(struct sock *sk, unsigned i= nt flags) struct mptcp_sendmsg_info info =3D { .flags =3D flags, }; - bool do_check_data_fin =3D false; + bool copied =3D false; struct mptcp_data_frag *dfrag; int len; =20 @@ -1703,7 +1703,7 @@ void __mptcp_push_pending(struct sock *sk, unsigned i= nt flags) goto out; } =20 - do_check_data_fin =3D true; + copied =3D true; info.sent +=3D ret; len -=3D ret; =20 @@ -1717,11 +1717,14 @@ void __mptcp_push_pending(struct sock *sk, unsigned= int flags) mptcp_push_release(ssk, &info); =20 out: - /* ensure the rtx timer is running */ - if (!mptcp_rtx_timer_pending(sk)) - mptcp_reset_rtx_timer(sk); - if (do_check_data_fin) + /* Avoid scheduling the rtx timer if no data has been pushed; the timer + * will be updated on positive acks by __mptcp_cleanup_una(). + */ + if (copied) { + if (!mptcp_rtx_timer_pending(sk)) + mptcp_reset_rtx_timer(sk); mptcp_check_send_data_fin(sk); + } } =20 static void __mptcp_subflow_push_pending(struct sock *sk, struct sock *ssk= , bool first) --=20 2.51.0 From nobody Mon Mar 2 06:41:56 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 1418B303A35; Wed, 11 Feb 2026 19:07:00 +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=1770836820; cv=none; b=qokhCJoDE4TgwFT10/sZVbyl4/rkasuVj5AMIpDIhT4RmG16exSOtXAndgl6UJgCbfd/eHLrlUKqwVps0OpKs63FUq6niMWF9pUHM5UQ85xK4OfHdNsRggyqxNMnJUJXSsGd8qGWXk98pN7CGSAdHvOzUAgP5RMaTSQIQ6pvPMo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770836820; c=relaxed/simple; bh=rMABZ5ULTsN0/8tg3HM626ypUOFeIMxiTKhtnZu4SKc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fxwWvYm4cHZaPYuVPpj1lyc6DLVHctQ81P07crvO2PklvhAtDNWeiE4h8MrFbXWTz+NndVcvenOUuBUAU9+KmHn6DEu6jUqY2Qw3g3A8qBoJ+0+R0uZF578evA8CzZec+A7xJ51Rtylf1rBbps02FwRBbpNsLQAIdg60Zb/I0QY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TdmjTZNv; 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="TdmjTZNv" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 69FC0C19423; Wed, 11 Feb 2026 19:06:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770836819; bh=rMABZ5ULTsN0/8tg3HM626ypUOFeIMxiTKhtnZu4SKc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TdmjTZNvzZ15iJ9pcgo7W1JzsO4Xi8iyVSe0VFVQBUGJLOOLv+01Zv+wyjpl+p006 vPZImeO7gYAIs1BbYTP0j1t4LYtcsa0ew8ZfJQ64KFTj9vOnTfe4FSTSDrcUpEQO5C OM6NMHWjSX6Bw1eMdItL/EhimX3dgZUiZzKXOMgczmMN/XMRDvcah2rox9FyO0sA1n GrpDIrj3ohwPMITz6MEr/Koe7ls+noNFpvD2XBdqA2jIklEY7/8HSo2VEJuf4Z7RfU uXwjC7JgryQJB9ZOBZSTbErO7GG546QFj/zsSk08RVJuUyuSccXG7Ir9KSBL4/4nU0 E0NthlffJB4Jw== From: "Matthieu Baerts (NGI0)" To: mptcp@lists.linux.dev, stable@vger.kernel.org, gregkh@linuxfoundation.org Cc: Paolo Abeni , sashal@kernel.org, "Matthieu Baerts (NGI0)" Subject: [PATCH 6.1.y 3/6] mptcp: ensure context reset on disconnect() Date: Wed, 11 Feb 2026 20:06:21 +0100 Message-ID: <20260211190617.77192-11-matttbe@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260211190617.77192-8-matttbe@kernel.org> References: <20260211190617.77192-8-matttbe@kernel.org> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=5474; i=matttbe@kernel.org; h=from:subject; bh=w+gVDIMZ7MyhCPB9jDcoWtrmZeRTY8/GXkykQ/ll+k8=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDJ7LusZ+7yU+/+55MaiN14N5w6Vn81j2tWcPHuaXNWG7 GeWSma8HaUsDGJcDLJiiizSbZH5M59X8ZZ4+VnAzGFlAhnCwMUpABO5Ls3IsG3FF1slpWn/Qntb phrnLz14TYLpYXip99F9533/PTZ/ksTI0H3bXyln8tQ7yjuOxEmd3Or8NqPP6oXl2d1CIUIaN1+ fYwQA X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Paolo Abeni commit 86730ac255b0497a272704de9a1df559f5d6602e upstream. After the blamed commit below, if the MPC subflow is already in TCP_CLOSE status or has fallback to TCP at mptcp_disconnect() time, mptcp_do_fastclose() skips setting the `send_fastclose flag` and the later __mptcp_close_ssk() does not reset anymore the related subflow context. Any later connection will be created with both the `request_mptcp` flag and the msk-level fallback status off (it is unconditionally cleared at MPTCP disconnect time), leading to a warning in subflow_data_ready(): WARNING: CPU: 26 PID: 8996 at net/mptcp/subflow.c:1519 subflow_data_ready= (net/mptcp/subflow.c:1519 (discriminator 13)) Modules linked in: CPU: 26 UID: 0 PID: 8996 Comm: syz.22.39 Not tainted 6.18.0-rc7-05427-g11= fc074f6c36 #1 PREEMPT(voluntary) Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 RIP: 0010:subflow_data_ready (net/mptcp/subflow.c:1519 (discriminator 13)) Code: 90 0f 0b 90 90 e9 04 fe ff ff e8 b7 1e f5 fe 89 ee bf 07 00 00 00 e= 8 db 19 f5 fe 83 fd 07 0f 84 35 ff ff ff e8 9d 1e f5 fe 90 <0f> 0b 90 e9 27= ff ff ff e8 8f 1e f5 fe 4c 89 e7 48 89 de e8 14 09 RSP: 0018:ffffc9002646fb30 EFLAGS: 00010293 RAX: 0000000000000000 RBX: ffff88813b218000 RCX: ffffffff825c8435 RDX: ffff8881300b3580 RSI: ffffffff825c8443 RDI: 0000000000000005 RBP: 000000000000000b R08: ffffffff825c8435 R09: 000000000000000b R10: 0000000000000005 R11: 0000000000000007 R12: ffff888131ac0000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 FS: 00007f88330af6c0(0000) GS:ffff888a93dd2000(0000) knlGS:0000000000000= 000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f88330aefe8 CR3: 000000010ff59000 CR4: 0000000000350ef0 Call Trace: tcp_data_ready (net/ipv4/tcp_input.c:5356) tcp_data_queue (net/ipv4/tcp_input.c:5445) tcp_rcv_state_process (net/ipv4/tcp_input.c:7165) tcp_v4_do_rcv (net/ipv4/tcp_ipv4.c:1955) __release_sock (include/net/sock.h:1158 (discriminator 6) net/core/sock.= c:3180 (discriminator 6)) release_sock (net/core/sock.c:3737) mptcp_sendmsg (net/mptcp/protocol.c:1763 net/mptcp/protocol.c:1857) inet_sendmsg (net/ipv4/af_inet.c:853 (discriminator 7)) __sys_sendto (net/socket.c:727 (discriminator 15) net/socket.c:742 (disc= riminator 15) net/socket.c:2244 (discriminator 15)) __x64_sys_sendto (net/socket.c:2247) do_syscall_64 (arch/x86/entry/syscall_64.c:63 (discriminator 1) arch/x86= /entry/syscall_64.c:94 (discriminator 1)) entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) RIP: 0033:0x7f883326702d Address the issue setting an explicit `fastclosing` flag at fastclose time, and checking such flag after mptcp_do_fastclose(). Fixes: ae155060247b ("mptcp: fix duplicate reset on fastclose") Cc: stable@vger.kernel.org Signed-off-by: Paolo Abeni Reviewed-by: Matthieu Baerts (NGI0) Signed-off-by: Matthieu Baerts (NGI0) Link: https://patch.msgid.link/20251212-net-mptcp-subflow_data_ready-warn-v= 1-2-d1f9fd1c36c8@kernel.org Signed-off-by: Paolo Abeni [ Conflicts in protocol.[ch] because the context has changed. ] Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/protocol.c | 9 ++++++--- net/mptcp/protocol.h | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index ad0bfdd308be..5274b19a5dbd 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -2456,10 +2456,10 @@ bool __mptcp_retransmit_pending_data(struct sock *s= k) */ static void __mptcp_subflow_disconnect(struct sock *ssk, struct mptcp_subflow_context *subflow, - unsigned int flags) + bool fastclosing) { if (((1 << ssk->sk_state) & (TCPF_CLOSE | TCPF_LISTEN)) || - subflow->send_fastclose) { + fastclosing) { /* The MPTCP code never wait on the subflow sockets, TCP-level * disconnect should never fail */ @@ -2511,7 +2511,7 @@ static void __mptcp_close_ssk(struct sock *sk, struct= sock *ssk, =20 need_push =3D (flags & MPTCP_CF_PUSH) && __mptcp_retransmit_pending_data(= sk); if (!dispose_it) { - __mptcp_subflow_disconnect(ssk, subflow, flags); + __mptcp_subflow_disconnect(ssk, subflow, msk->fastclosing); if (msk->subflow && ssk =3D=3D msk->subflow->sk) msk->subflow->state =3D SS_UNCONNECTED; release_sock(ssk); @@ -2802,6 +2802,8 @@ static void mptcp_do_fastclose(struct sock *sk) struct mptcp_subflow_context *subflow, *tmp; struct mptcp_sock *msk =3D mptcp_sk(sk); =20 + msk->fastclosing =3D 1; + /* Explicitly send the fastclose reset as need */ if (__mptcp_check_fallback(msk)) return; @@ -3290,6 +3292,7 @@ static int mptcp_disconnect(struct sock *sk, int flag= s) WRITE_ONCE(msk->csum_enabled, mptcp_is_checksum_enabled(sock_net(sk))); mptcp_pm_data_reset(msk); mptcp_ca_reset(sk); + msk->fastclosing =3D 0; =20 WRITE_ONCE(sk->sk_shutdown, 0); sk_error_report(sk); diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index 6575712c789e..dd5070d57d74 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -289,7 +289,8 @@ struct mptcp_sock { nodelay:1, fastopening:1, in_accept_queue:1, - free_first:1; + free_first:1, + fastclosing:1; int keepalive_cnt; int keepalive_idle; int keepalive_intvl; --=20 2.51.0 From nobody Mon Mar 2 06:41:56 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 594EA346ADC; Wed, 11 Feb 2026 19:07:02 +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=1770836822; cv=none; b=BIclupD32rKanEjG/5GM6UkrB59jcG5YLrVN9Gr6U9pNioJ/siw0ms9xS4p89I5G4TnIzuuDYHAHkHbsJvchV0gvL5iZ3ks08US+RET4FrJAIVmZanHmdD1hzoXIOYWdm4FKuDegqz9Cv8cwzZ+hcLx5gv8p6/rp9r3Zyn13krQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770836822; c=relaxed/simple; bh=VMMvFuctzIugS+JOh0W1dLNT4/NhATHAqY0+7G6/H3I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GLzKIzvQda0ov9zxgxsXM+KHTgPtlSGqTVqpaLPLoYJxW9oBdwIvowb0mJ0aXdczM68zzF+Xuh4Gs33YHK/FyVGu4t8vdqyteaUmEis3ewfHWsLsJoxWiIHEULX5DEDWwluGMjg6v3pi3ZJOczYPBeU3YRY8g/07c5Lpw7DQ0UQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PNtsY1Iz; 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="PNtsY1Iz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B255C19424; Wed, 11 Feb 2026 19:07:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770836821; bh=VMMvFuctzIugS+JOh0W1dLNT4/NhATHAqY0+7G6/H3I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PNtsY1Iz+XjvKQy7n5hdrcRR3g2en9OV2UP0XOF/2Lz3ZNMAHqDeKgv0Tv04sVuLc J+ZTlGf3bFdDSL/KlEpJM6ZhezkqEZ7OFaOpNruNruWEyoY382o+lZulB/mJEG5mob muY+CtObhn6oP7nWrrbUqEl5QoD57gWXHq1wRnaI0W+q52eFrAXXllNe2kJzhCQvkx E/u8FYclEipnqvrxn1Gf+i+ZXNLJr6HxVoUFbaXwekwW0kbYlDCGHs9PmfGPSiPi/e B3b/855lx4cBtfioJKA3no9h0NBFiNAfyKHUcU19Pk4OQ/AblXvaowCvMTE2LXITX0 HE0k+IgHm5VWg== From: "Matthieu Baerts (NGI0)" To: mptcp@lists.linux.dev, stable@vger.kernel.org, gregkh@linuxfoundation.org Cc: "Matthieu Baerts (NGI0)" , sashal@kernel.org, Geliang Tang , Jakub Kicinski Subject: [PATCH 6.1.y 4/6] selftests: mptcp: check no dup close events after error Date: Wed, 11 Feb 2026 20:06:22 +0100 Message-ID: <20260211190617.77192-12-matttbe@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260211190617.77192-8-matttbe@kernel.org> References: <20260211190617.77192-8-matttbe@kernel.org> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=5019; i=matttbe@kernel.org; h=from:subject; bh=VMMvFuctzIugS+JOh0W1dLNT4/NhATHAqY0+7G6/H3I=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDJ7LuuvLD3ct6AiJa/3KotP0JU7ctzVHnPUT86L/FS2w uuxxqLmjlIWBjEuBlkxRRbptsj8mc+reEu8/Cxg5rAygQxh4OIUgIlsNGf4p/XHb/nFzvKfii4T FwQn/hKZ5z9Rf8aUI199GPedrv6zz5KR4Vf97ZCjubOl34t0P32ctnmx4WuvLCf7DSzpLNJJW6Y IcwEA X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" commit 8467458dfa61b37e259e3485a5d3e415d08193c1 upstream. 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) Link: https://patch.msgid.link/20260127-net-mptcp-dup-nl-events-v1-2-7f71e1= bc4feb@kernel.org Signed-off-by: Jakub Kicinski [ Conflicts in mptcp_join.sh, because in this version, commit 20ccc7c5f7a3 ("selftests: mptcp: join: validate event numbers") has been backported with adaptations to display results correctly, see commit 5dc9170eee96 ("selftests: mptcp: join: validate event numbers") for more details. The same type of adaptations had to be made here as well, plus importing a few additional helpers: userspace_pm_add_sf, evts_get_info and get_info_value. ] Signed-off-by: Matthieu Baerts (NGI0) --- .../testing/selftests/net/mptcp/mptcp_join.sh | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testin= g/selftests/net/mptcp/mptcp_join.sh index 9f73297b69da..f5ae51dcf811 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3183,6 +3183,35 @@ fail_tests() fi } =20 +# get the value of keyword $1 in the line marked by keyword $2 +get_info_value() { + grep "${2}" 2>/dev/null | + sed -n 's/.*\('"${1}"':\)\([0-9a-f:.]*\).*$/\2/p;q' + # the ';q' at the end limits to the first matched entry. +} + +# $1: info name ; $2: evts_ns ; [$3: event type; [$4: addr]] +evts_get_info() { + grep "${4:-}" "${2}" 2>/dev/null | + get_info_value "${1}" "^type:${3:-1}," +} + +# $1: ns ; $2: addr ; $3: id +userspace_pm_add_sf() +{ + local evts=3D$evts_ns1 + local tk da dp + + [ "$1" =3D=3D "$ns2" ] && evts=3D$evts_ns2 + tk=3D$(evts_get_info token "$evts") + da=3D$(evts_get_info daddr4 "$evts") + dp=3D$(evts_get_info dport "$evts") + + ip netns exec $1 ./pm_nl_ctl csf lip $2 lid $3 \ + rip $da rport $dp token $tk + sleep 1 +} + # $1: ns ; $2: event type ; $3: count chk_evt_nr() { @@ -3204,11 +3233,32 @@ chk_evt_nr() echo "[fail] got $count events, expected $exp" fail_test dump_stats + cat "${evts}" else echo "[ 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 @@ -3302,6 +3352,35 @@ userspace_tests() chk_join_nr 1 1 1 chk_rm_nr 0 1 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 + run_tests $ns1 $ns2 10.0.1.1 128 0 0 slow 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_subflow_nr needtitle "new subflow" 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_subflow_nr "" "after reject" 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_wait "${tests_pid}" + kill_events_pids + kill_tests_wait + fi } =20 endpoint_tests() --=20 2.51.0 From nobody Mon Mar 2 06:41:56 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 68C32347BBD; Wed, 11 Feb 2026 19:07:04 +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=1770836824; cv=none; b=d9AWdSxGtH44xDdXhuY2MJuVPtfWM/WXz0sEVl0Q6RhW/WG8i1xlfxif8U/g/8hF/LgUTTAAjKzQIq37L1BqXegilU0rVa5NBexQWqdxRQjmEu8C8PA4RBAtzYUSoo1pGRR4wC1gIidv6oJdeiWomOCoSR4IMrShQOP2YIF2HCU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770836824; c=relaxed/simple; bh=6gFMK2Vf97i3HtqOLYHeDgbtTbc1n1AgCHsY6Wvr8yI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tm887FqdWPFqgw9nMLXtk6tWT/p9sFH+DcFAStqa0tV6mdFF+Hmqa+/yzfYElMrGChB3ph5ktdKubLQBRVHS48RnpiiIj2wl7QIQtOjG5c9dKKeba4qbu8kGtsD8MRSJsdleIBsPCcDXiHY3wT3OEcoDmqjT8pHtfG6GhPWhug0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=K27vIPzB; 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="K27vIPzB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A50B5C4CEF7; Wed, 11 Feb 2026 19:07:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770836824; bh=6gFMK2Vf97i3HtqOLYHeDgbtTbc1n1AgCHsY6Wvr8yI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K27vIPzBZaxwAHo6xM1REpmyJ+A9PHn5WZg2IE9SlcLB1DjkTRZPVNy7vWmquQ3o2 vbf/0P7YpgOtS72QUe3KCU1RUIzoeJYR3N8CQS81AzLdKosw/MjSx5/hziID5luGOq vRDKtvy1jgHCaJgW/fZwvT1KSc4L4srHxdevR6VZUUwo+aPGnu8rj7TejnA3ycN348 77yy3RZr7oQ2O61nNeMpawPbmjsGUN2mAfyDkvhybJOLHpdmwxTslwHxYdAyCXMw0d aNxkg6qoui/HZ600mr6I2b4dJ1TmPVka/Q7CFmbudvReb7P7znDy1GP26LxsF9EqCR JrMvsTcYSPuGg== From: "Matthieu Baerts (NGI0)" To: mptcp@lists.linux.dev, stable@vger.kernel.org, gregkh@linuxfoundation.org Cc: "Matthieu Baerts (NGI0)" , sashal@kernel.org, Geliang Tang , Jakub Kicinski Subject: [PATCH 6.1.y 5/6] selftests: mptcp: check subflow errors in close events Date: Wed, 11 Feb 2026 20:06:23 +0100 Message-ID: <20260211190617.77192-13-matttbe@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260211190617.77192-8-matttbe@kernel.org> References: <20260211190617.77192-8-matttbe@kernel.org> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3369; i=matttbe@kernel.org; h=from:subject; bh=6gFMK2Vf97i3HtqOLYHeDgbtTbc1n1AgCHsY6Wvr8yI=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDJ7Lhskd0XvqD0krq4SOVGxMbcmwvVpkalKYvSc3+6Hd ZMPnzXuKGVhEONikBVTZJFui8yf+byKt8TLzwJmDisTyBAGLk4BmEhHCMMfrhU3dp1Nv++V6xVs 6aRxJ1ki7XOo8pGWvsyV8/bvXuypzMjwoiBVrjBvW+Vaj18yfo5fM4reznlWoSjkdkr2nQlvTzs fAA== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" commit 2ef9e3a3845d0a20b62b01f5b731debd0364688d upstream. 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) Link: https://patch.msgid.link/20260127-net-mptcp-dup-nl-events-v1-4-7f71e1= bc4feb@kernel.org Signed-off-by: Jakub Kicinski [ Conflicts in mptcp_join.sh, because in this version, commit 20ccc7c5f7a3 ("selftests: mptcp: join: validate event numbers") has been backported with adaptations to display results correctly, see commit 5dc9170eee96 ("selftests: mptcp: join: validate event numbers") for more details. The same type of adaptations had to be made here as well. ] Signed-off-by: Matthieu Baerts (NGI0) --- .../testing/selftests/net/mptcp/mptcp_join.sh | 25 ++++++++++++++++--- 1 file changed, 22 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 f5ae51dcf811..7d4df90d6281 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3212,21 +3212,28 @@ userspace_pm_add_sf() sleep 1 } =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 - printf "%-${nr_blank}s %s" " " "event ${ns} ${evt_name} (${exp})" + printf "%-${nr_blank}s %s" " " "event ${ns} ${evt_name} (${exp}${attr_nam= e})" =20 count=3D$(grep -cw "type:${evt}" "${evts}") if [ "${count}" !=3D "${exp}" ]; then @@ -3234,6 +3241,18 @@ chk_evt_nr() fail_test dump_stats cat "${evts}" + return + elif [ -z "${attr}" ]; then + echo "[ ok ]" + return + fi + + count=3D$(grep -w "type:${evt}" "${evts}" | grep -c ",${attr}:") + if [ "${count}" !=3D "${attr_exp}" ]; then + echo "[fail] got ${count} event attributes, expected ${attr_exp}" + fail_test + dump_stats + grep -w "type:${evt}" "${evts}" else echo "[ ok ]" fi @@ -3375,7 +3394,7 @@ userspace_tests() chk_subflow_nr "" "after reject" 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_wait "${tests_pid}" kill_events_pids --=20 2.51.0 From nobody Mon Mar 2 06:41:56 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 6B4F427707; Wed, 11 Feb 2026 19:07:06 +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=1770836826; cv=none; b=udgRDL9xWS6ZQ2dOc3Q0ZJAo0Q8PUU22dxLXQLue8Cx5r3p88BrOD06aJz9t0EVJXWiPikmqD6L6d/rc9xyi8aZ5FbbvD6jN9sO7j88Yme5WYaSnnO8QiBwWODcIlabjf9HmnRHurTzR0VI33iKnFz30NlDtCJ8S4c4V/rstXJw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770836826; c=relaxed/simple; bh=4ilfBfueSL/qCRRY/D5V1mAmH6Qzgsf5jWHBTlRngKo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=efHqvUiKuVYQ0SNzDDEnbdXccNr7o8G/belNS247z6IlwOINMXSQTXXnSoEXev79DD3+bxpjUp1nZsjtaD2K4jxiGKBlpSU+4ua74EcPZMii16Xrr2FMADajlvPk/AKZe0odgQ70mGCtjUsQM/lwwWk2pqdH6Y6rw8ljTf8/srQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=srcnZadh; 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="srcnZadh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5498BC19424; Wed, 11 Feb 2026 19:07:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770836826; bh=4ilfBfueSL/qCRRY/D5V1mAmH6Qzgsf5jWHBTlRngKo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=srcnZadhU6ao5uJGSJSNkIzFXciqlGREg0vzSD4r3u/NyQs2oBjpuYqQNlYWnetBu WXtizJ8xqncXtCUUrNQ4EGK53JfR35SbYRtGBP3QjNAdxzeYm0OyLi+ZOliIdnWWYb DstLF8Hwgiaq7nV1Gsfoj2DG8YQtD0u7xsWAANgjdn/0oJnMiXyMBiOrW8Ct6MyBpH Dqtnc+tDvXtMkOQt/tUO3CHPBJ0Vwmi8Esr7r3wXEJle2T5oWuibzkvSW0VTlwmgb0 rz0hdeUbRPe0nmSKcYA7a+d8yR738shBMlD1ykw8wXPiPyxQjeo4WuDO6w3P+65zbv 0csdoZRp/iXbg== From: "Matthieu Baerts (NGI0)" To: mptcp@lists.linux.dev, stable@vger.kernel.org, gregkh@linuxfoundation.org Cc: "Matthieu Baerts (NGI0)" , sashal@kernel.org, Mat Martineau , Jakub Kicinski Subject: [PATCH 6.1.y 6/6] selftests: mptcp: join: fix local endp not being tracked Date: Wed, 11 Feb 2026 20:06:24 +0100 Message-ID: <20260211190617.77192-14-matttbe@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260211190617.77192-8-matttbe@kernel.org> References: <20260211190617.77192-8-matttbe@kernel.org> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2716; i=matttbe@kernel.org; h=from:subject; bh=4ilfBfueSL/qCRRY/D5V1mAmH6Qzgsf5jWHBTlRngKo=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDJ7LhtM6PFeGNi90sd4+lnJbZkLdk6YYlK3f/fdPs6MC f/nHK1Q7ChlYRDjYpAVU2SRbovMn/m8irfEy88CZg4rE8gQBi5OAZjImSpGhssRP37Mb1l/Krel eq/8zHWr1yl8mzf/BePWju4H5hPML6xkZFhQ8bNYVfLo1gK9OYe1Zs225tN3qd4g3eZX+c92ucO NFl4A X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" commit c5d5ecf21fdd9ce91e6116feb3aa83cee73352cc upstream. 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) Link: https://patch.msgid.link/20260127-net-mptcp-dup-nl-events-v1-5-7f71e1= bc4feb@kernel.org Signed-off-by: Jakub Kicinski [ Conflicts in mptcp_join.sh, because commit e571fb09c893 ("selftests: mptcp: add speed env var") is not in this version, and caused conflicts in the context. The same modification can still be applied at the same place. ] 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 7d4df90d6281..5a40e09e8374 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -2181,17 +2181,16 @@ signal_address_tests() # the peer could possibly miss some addr notification, allow retransmiss= ion ip netns exec $ns1 sysctl -q net.mptcp.add_addr_timeout=3D1 run_tests $ns1 $ns2 10.0.1.1 0 0 0 slow + 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