From nobody Mon Aug 24 11:09:59 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 E5474427FB3 for ; Mon, 27 Jul 2026 17:22:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785172932; cv=none; b=iXQ6bY+GYaf+BK+G4W3y/cIe6ADwL8akXx9K0/kvY6m5h2+YOOsVaQ0BXKIVxtch9B2frOYWvK0YZ7EILFumFuE5Mifist/Lms0wKHGVc4w+JTQgyWzhZdtegqAEcgN6PJz5PhUJYTkraquunrv91OniBbNRGZ8LAQaMO8xiMHc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785172932; c=relaxed/simple; bh=NVrf8jHNtA9y/hbHfmk9WChvN4+t6mG9LKED9lZgBz4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Gtunc8V4FQhkptRzwaDhrGNzgNCtp5GXIWuUBTHRZrdl4EmoAHHyXwVpxG+/4nG23XfMRv3A6xzvaIKFgbtBh1VQP57QkdDrA4DOIhmEjrMXaqhcWnvB/GwLUGaR+K4XKGRtenaAPEvw7qDunwt6RC+xvTemKQjfV83s8Iuxpoc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Uv68jj/4; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Uv68jj/4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30FB01F00A3D; Mon, 27 Jul 2026 17:22:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1785172930; bh=HxZM1f1cz1OQVFwy8cdF8E3WzPVsGgFIHkbj8N1R5KQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=Uv68jj/4NUo3Ex6BPVGxH7qIR83uCeQqygC4MgfSqYz+boYDNGZbU/lceHB4zm5ry SyobNdlGkm03tZOKBTzhB5WWhil9Agra6XreLObWDsZd5xemsXTdBVIQyLljKUyPxp KEW3CPuCTxF6TQ2y0h8e4QZEN7GkRWOyLgkfqdRw6U/U6deUiidLxoYG/WePewCT9o bQdlKoQYadJwvcGYyMx69DEgu8MIrXdcGIwfu+xpLsEm6gVf0MHJ5akc7jO/UNNGtz ib2VcpDeZ8vj3f2fl7guYt1Wr/aUJhvwhwjeaeS33NPmwE5UifhxlxqOouhj55ThnP TA8m2BTe4yyyg== From: "Matthieu Baerts (NGI0)" Date: Mon, 27 Jul 2026 19:21:50 +0200 Subject: [PATCH mptcp-net 1/6] mptcp: pm: userspace: properly handle the ID0 case 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: <20260727-mptcp-pm-userspace-id0-case-v1-1-9877f02a9bae@kernel.org> References: <20260727-mptcp-pm-userspace-id0-case-v1-0-9877f02a9bae@kernel.org> In-Reply-To: <20260727-mptcp-pm-userspace-id0-case-v1-0-9877f02a9bae@kernel.org> To: MPTCP Linux Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=4414; i=matttbe@kernel.org; h=from:subject:message-id; bh=NVrf8jHNtA9y/hbHfmk9WChvN4+t6mG9LKED9lZgBz4=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGLLSJ2//u477fdFbp2CrOKUtfJ5WnfF8xgvO/9k+3y9l1 h6pqRx9HaUsDGJcDLJiiizSbZH5M59X8ZZ4+VnAzGFlAhnCwMUpABO5GM3IsK2htz51+dzH3KeU v7SrPXJYIRJv82xLZj1fzR6u2cm3dRkZ1rg2MVxd+fzQ4/DTnH28te8io/mz3vUuesXh5eol0m7 JDgA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 In MPTCP, the local address and port used by the initial subflow has the ID "0". It means that when this address and port are used for some operations -- e.g. creating a new subflow -- they should be linked to the ID0, and no other addresses and ports can get this special ID while the initial IP address and port is used. So far, the ID0 case was handled as an exception: each operation dealing with the ID0 had to be handled differently. Except that this was done in some places like removing the ID0, but not everywhere the list of local addresses was iterated. This way of handling the ID0 is prone to bugs and harder to maintain. Instead, the initial local address corresponding to ID0 can be added to the list when a connection is created, and the number of exceptions can be dramatically reduced, handling this case like any others with existing local address. The existing exceptions are going to be removed in the following patches. The main downside of this is that each connection will now have one allocated entry added the list, possibly one more than before. But that seems OK to do that with the userspace PM where the path management is done per connection, with many Netlink messages sent back and forth. Adding a few more bytes per connections on such setup seems acceptable. Fixes: 4638de5aefe5 ("mptcp: handle local addrs announced by userspace PMs") Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/pm.c | 4 ++++ net/mptcp/pm_userspace.c | 23 ++++++++++++++++++++++- net/mptcp/protocol.h | 1 + 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c index 05e29ce18b26..8421048f1a20 100644 --- a/net/mptcp/pm.c +++ b/net/mptcp/pm.c @@ -548,6 +548,10 @@ void mptcp_pm_new_connection(struct mptcp_sock *msk, c= onst struct sock *ssk, int pr_debug("msk=3D%p, token=3D%u side=3D%d\n", msk, READ_ONCE(msk->token), = server_side); =20 WRITE_ONCE(pm->server_side, server_side); + + if (mptcp_pm_is_userspace(msk)) + mptcp_pm_userspace_created(msk, ssk); + mptcp_event(MPTCP_EVENT_CREATED, msk, ssk, GFP_ATOMIC); } =20 diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c index 73094bdbdbf2..6e6eeda91ade 100644 --- a/net/mptcp/pm_userspace.c +++ b/net/mptcp/pm_userspace.c @@ -55,7 +55,10 @@ static int mptcp_userspace_pm_append_new_local_addr(stru= ct mptcp_sock *msk, =20 spin_lock_bh(&msk->pm.lock); mptcp_for_each_userspace_pm_addr(msk, e) { - addr_match =3D mptcp_addresses_equal(&e->addr, &entry->addr, true); + /* allow matching ID0 when no port is specified */ + addr_match =3D mptcp_addresses_equal(&e->addr, &entry->addr, + e->addr.id !=3D 0 || + entry->addr.port !=3D 0); if (addr_match && entry->addr.id =3D=3D 0 && needs_id) entry->addr.id =3D e->addr.id; id_match =3D (e->addr.id =3D=3D entry->addr.id); @@ -692,6 +695,24 @@ int mptcp_userspace_pm_get_addr(u8 id, struct mptcp_pm= _addr_entry *addr, return ret; } =20 +/* Add the initial local address (ID0) to the local list: easier that way = */ +void mptcp_pm_userspace_created(struct mptcp_sock *msk, const struct sock = *ssk) +{ + struct mptcp_pm_addr_entry *entry; + + entry =3D sock_kmalloc((struct sock *)msk, sizeof(*entry), GFP_ATOMIC); + /* Fine not to handle the ID0 case in memory pressure */ + if (!entry) + return; + + memset(entry, 0, sizeof(*entry)); + mptcp_local_address((struct sock_common *)ssk, &entry->addr); + + spin_lock_bh(&msk->pm.lock); + list_add_tail_rcu(&entry->list, &msk->pm.userspace_pm_local_addr_list); + spin_unlock_bh(&msk->pm.lock); +} + static void mptcp_pm_userspace_release(struct mptcp_sock *msk) { mptcp_userspace_pm_free_local_addr_list(msk); diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index da40c6f3705f..087367cdd307 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -1236,6 +1236,7 @@ void __init mptcp_pm_userspace_register(void); void __init mptcp_pm_nl_init(void); void mptcp_pm_worker(struct mptcp_sock *msk); void __mptcp_pm_kernel_worker(struct mptcp_sock *msk); +void mptcp_pm_userspace_created(struct mptcp_sock *msk, const struct sock = *ssk); u8 mptcp_pm_get_endp_signal_max(const struct mptcp_sock *msk); u8 mptcp_pm_get_endp_subflow_max(const struct mptcp_sock *msk); u8 mptcp_pm_get_endp_laminar_max(const struct mptcp_sock *msk); --=20 2.53.0 From nobody Mon Aug 24 11:09:59 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 132D642CB1F for ; Mon, 27 Jul 2026 17:22:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785172934; cv=none; b=Mx34eqUbhiAnJt9ykihUqU96mRmi8tHVYqREVMHgtjIWG5dAzrVeGDiL+JJBtvS3XOWittv1VkRcmQIdoPu2eP4LWq7aC0ozq8/57+4O5mNK4UDAZlTEKI8ThFnvu3I8a9n8aaLenbLOiuB6imvXRM52YuO35zYwaTRG4la3jZs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785172934; c=relaxed/simple; bh=cbY+tw0KHJcAFg1rOHJ4xMRDbksFvQiqwDFczVBeaRs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kkjfe1GV1je3jj7/8LHWu6nlX1BPMPRqFZircvWfCzujJHO2otO+ztV563Bw1Ngt4xel4S10MP8HhGTZQpV2PU1lQkX6im+7EGriYQ/GoIRsfVPUegzdPf5udsM82wJiHu+mzAyI+fYsmyJKtmHfuO2+t95xORBFjwq6v2XSCe8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jWMVh4Kk; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jWMVh4Kk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03BBF1F00A3A; Mon, 27 Jul 2026 17:22:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1785172931; bh=awGRv67NcViXC7sGP+VTuIr1AnexhXsuIFT4h/2zPHY=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=jWMVh4KkcNhvn0q98Bl0zsQp93fTFwItCuIDqHGpE8zwFFG/Zu0TWRvWRfMbEFXU8 gfM3Xd8U2JK/vvmXecqpQ9mcy/NclNHqON4rVr0NaI5L8W5yMAkZPINmDlkk+3O0G3 Q936eYXA8zLfejp2h6f7FxDPuqHZn8qxJkh9IxYuF1eNlnTHg2VnuMhocAQjruHKkO ERiJ6O/1WyAE/ZyJYuklDRQLcukRKnQSMuIhXO+WBiaHpbQYZFwbPT/Ty+lA0JE6m7 0lryvrePQSpeI3YMyaR/YnAPkj3FxhZ3mFTAwcRA34B1vOMzVMt8lcmUUBfP9lwB8y 2QR6Zu4Y/8t3A== From: "Matthieu Baerts (NGI0)" Date: Mon, 27 Jul 2026 19:21:51 +0200 Subject: [PATCH mptcp-net 2/6] mptcp: pm: userspace: allow announcing ID0 addr 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: <20260727-mptcp-pm-userspace-id0-case-v1-2-9877f02a9bae@kernel.org> References: <20260727-mptcp-pm-userspace-id0-case-v1-0-9877f02a9bae@kernel.org> In-Reply-To: <20260727-mptcp-pm-userspace-id0-case-v1-0-9877f02a9bae@kernel.org> To: MPTCP Linux Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1165; i=matttbe@kernel.org; h=from:subject:message-id; bh=cbY+tw0KHJcAFg1rOHJ4xMRDbksFvQiqwDFczVBeaRs=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGLLSJ+9MNp/m2G2UvNXtr7LpAb77YcEPJk71Zzdq2Fx0s 3hCGf/fjlIWBjEuBlkxRRbptsj8mc+reEu8/Cxg5rAygQxh4OIUgImEGTP8d/8x0bL3i9f7YqXA uAsfNzv0JCWnscx+JilufjLh7DHbUIbfbD+OZT5nqZqt/twwT4Pf7c27Grk/jzcff+5y49CeAqs HnAA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 It is valid to announce an address with the ID0, the in-kernel PM allows to do that when re-announcing the initial IP address after having been deleted. So no need to have such exception. If the ID is set to 0, but the address doesn't match with the existing one, an error will be returned by mptcp_userspace_pm_append_new_local_addr(). Fixes: 9ab4807c84a4 ("mptcp: netlink: Add MPTCP_PM_CMD_ANNOUNCE") Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/pm_userspace.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c index 6e6eeda91ade..4c96433590e3 100644 --- a/net/mptcp/pm_userspace.c +++ b/net/mptcp/pm_userspace.c @@ -212,12 +212,6 @@ int mptcp_pm_nl_announce_doit(struct sk_buff *skb, str= uct genl_info *info) if (err < 0) goto announce_err; =20 - if (addr_val.addr.id =3D=3D 0) { - NL_SET_ERR_MSG_ATTR(info->extack, addr, "invalid addr id"); - err =3D -EINVAL; - goto announce_err; - } - if (!(addr_val.flags & MPTCP_PM_ADDR_FLAG_SIGNAL)) { NL_SET_ERR_MSG_ATTR(info->extack, addr, "invalid addr flags"); err =3D -EINVAL; --=20 2.53.0 From nobody Mon Aug 24 11:09:59 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 D67D04248B2 for ; Mon, 27 Jul 2026 17:22:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785172934; cv=none; b=GOjq+RE1rEXcuZN0UoMrymU901QXNMp0AZwAvD5esBqhmdFitMKa80C1ndav1Qidx61tapbrl0oh9TWbagZ7COMgkOr3h9jkiiAVxXR/faGUN4Q4vmNp17v9tnaTu0QD6SuZFw3ai6aU8wDqE8qCfL98+KiUnoNezAqlOTrrL2o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785172934; c=relaxed/simple; bh=ex3YVuaXwyzDajq6Z5anTikGQasl6kl8ydQkWXVsnR8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LYxFaOibnKYiJrMqpoMy1UK5/Ty+cW5q/RoDMXNcOJGZ8YSnT8oWyfyZqTduydUsEkHAZjeSlQ31tMMibldNWsS7I9zFU2ZXu46kxYcaPibZUUPB1qD2406JOHIRGjNPec7ihe/UqL5/JMKVHxraSwSzBTgQI15FVDvEEGMOHTo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Sh76W/VA; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Sh76W/VA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CB6F41F000E9; Mon, 27 Jul 2026 17:22:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1785172932; bh=ywtwCXSEqVJDkD1HcIxykQ87R3b3FsnotfhhL+dXzIg=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=Sh76W/VA6dmdeBtpoJ2Gpqm/FG+Dr+9KcEAcpnSgK3IZTejc5AmNEJiVwxlzDZPwG GV+OUZnmy+sA5hUDNpdgkWYjxqB3TSSnb5MyJv6EO0iJqWWRq1Yfs235AB0gpjvf6I uT1URFS2R/+Q51QmfDA1HQPAO6pZPgIQsqLe+YExcpYHbYBT8UCnIzoaWLW/W7S3ba h+Z1UYo8HQvO6kAhwL6L+JTe6RyAqvtp63TOaz2q/VEj50oPicEb8Obto0yVIb6bBp 4Alpt0P4uuqeuMYpPNQUKGQCnUiVEVkhGOtEz3oNghvQl7T8hHvFPxoLB4xJJ7x7rH WM8N0++bkM7dw== From: "Matthieu Baerts (NGI0)" Date: Mon, 27 Jul 2026 19:21:52 +0200 Subject: [PATCH mptcp-net 3/6] mptcp: pm: userspace: no ID0 exception for RM_ADDR 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: <20260727-mptcp-pm-userspace-id0-case-v1-3-9877f02a9bae@kernel.org> References: <20260727-mptcp-pm-userspace-id0-case-v1-0-9877f02a9bae@kernel.org> In-Reply-To: <20260727-mptcp-pm-userspace-id0-case-v1-0-9877f02a9bae@kernel.org> To: MPTCP Linux Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1821; i=matttbe@kernel.org; h=from:subject:message-id; bh=ex3YVuaXwyzDajq6Z5anTikGQasl6kl8ydQkWXVsnR8=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGLLSJ++676nhbnzO/oC+0MmvDZ9ifxbF9E2dmPJEJFHd+ OzlG2afOkpZGMS4GGTFFFmk2yLzZz6v4i3x8rOAmcPKBDKEgYtTACbS6cHwz+qc31GdvzcCKyet YfyyKL+lVmiOhPt9piKn+JSX/gtt9jMyPI1kunDgwtH9untqym5OChJyj7/LHSbRYHTqm7H0hNn P2AE= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 After the first patch of this series, the initial ID0 address is present in the local addr list when the connection has been created. Then, no need to have an exception to delete ID0, this can be done like with other IDs. Fixes: 84c531f54ad9 ("mptcp: userspace pm send RM_ADDR for ID 0") Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/pm_userspace.c | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c index 4c96433590e3..9c7fab6a59bf 100644 --- a/net/mptcp/pm_userspace.c +++ b/net/mptcp/pm_userspace.c @@ -243,37 +243,6 @@ int mptcp_pm_nl_announce_doit(struct sk_buff *skb, str= uct genl_info *info) return err; } =20 -static int mptcp_userspace_pm_remove_id_zero_address(struct mptcp_sock *ms= k) -{ - struct mptcp_rm_list list =3D { .nr =3D 0 }; - struct mptcp_subflow_context *subflow; - struct sock *sk =3D (struct sock *)msk; - bool has_id_0 =3D false; - int err =3D -EINVAL; - - lock_sock(sk); - mptcp_for_each_subflow(msk, subflow) { - if (READ_ONCE(subflow->local_id) =3D=3D 0) { - has_id_0 =3D true; - break; - } - } - if (!has_id_0) - goto remove_err; - - list.ids[list.nr++] =3D 0; - - spin_lock_bh(&msk->pm.lock); - mptcp_pm_remove_addr(msk, &list); - spin_unlock_bh(&msk->pm.lock); - - err =3D 0; - -remove_err: - release_sock(sk); - return err; -} - void mptcp_pm_remove_addr_entry(struct mptcp_sock *msk, struct mptcp_pm_addr_entry *entry) { @@ -315,11 +284,6 @@ int mptcp_pm_nl_remove_doit(struct sk_buff *skb, struc= t genl_info *info) =20 sk =3D (struct sock *)msk; =20 - if (id_val =3D=3D 0) { - err =3D mptcp_userspace_pm_remove_id_zero_address(msk); - goto out; - } - lock_sock(sk); =20 spin_lock_bh(&msk->pm.lock); --=20 2.53.0 From nobody Mon Aug 24 11:09:59 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 7CDBE42A794 for ; Mon, 27 Jul 2026 17:22:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785172937; cv=none; b=C4iLBDOnz9govvaLd0DjxnXDouitCPHB4hzByG0bvPMgQ5BqLlKJjsFBcLr5qQKiNWG4MXXJPVmB31N/sgZ4gI6B8OkaTRK/19hJDTNlWQlnQslqZn9gDHxfsJ2IBf7CuQTENkgf3HZTMDOMg5ApP23Xwg+RpVYkkFv8QE72ibU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785172937; c=relaxed/simple; bh=yP1BRNA6woQo0BMxYA3BzemPE5NDI2dk/Rk8Rvh/5YI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ru6ntxsj2XtbnHpswaMp2DBjcMqN80erLj8hzOYeqzhwtm+MmgmTKj2Rth9O0qIAdfBV2oH7jMWouP2XDKjnS1ruTyzjHXa7mxaP8uPANTrkjUQxWQYtByIGke0ddlTIVEe4ncPAoSTLBCbDv8nUXP5rsxVDqUJ3ic5LIYSmVJg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AC6xG4kq; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AC6xG4kq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E4841F00A3D; Mon, 27 Jul 2026 17:22:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1785172933; bh=KsEfpexFrZyJ/BampPNQ0ApRejnp0RM4eQ6JM2jOhPg=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=AC6xG4kqterJ7MBVxQ5PEc8DH8oOyB/38RxIcSKEMImtqnLoYwdQXSrd3AwMaVkma HSAxUCU5VSOrBeO5vD8dlgK5iaDeGMfupRugfxUs92C/uw3+ozWHqi63J9KAvk6ZYx Na5d6ms1TisB+aFoUz3wJj6fm1ugZUo89pO4aOPnvqGVkkJ3uRnUcvGeDG1YqHwnN2 VVmKevk+iATsd7HIYgLtR5dK13wyKy9ZUy42v/22tMxUJr4h6dsAVSZXC1bHgLvJ1+ lr5KjdGlmHMmzz7S9ybSjcB7a2wgKRl6Cy22e+aQbZ+GGUb9yoB3DqrFZPSqaH+Ol5 kdLzM670t3zVg== From: "Matthieu Baerts (NGI0)" Date: Mon, 27 Jul 2026 19:21:53 +0200 Subject: [PATCH mptcp-net 4/6] mptcp: pm: userspace: don't dump initial ID0 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: <20260727-mptcp-pm-userspace-id0-case-v1-4-9877f02a9bae@kernel.org> References: <20260727-mptcp-pm-userspace-id0-case-v1-0-9877f02a9bae@kernel.org> In-Reply-To: <20260727-mptcp-pm-userspace-id0-case-v1-0-9877f02a9bae@kernel.org> To: MPTCP Linux Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1246; i=matttbe@kernel.org; h=from:subject:message-id; bh=yP1BRNA6woQo0BMxYA3BzemPE5NDI2dk/Rk8Rvh/5YI=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGLLSJ+/xc4qz0S4043kolWv+XCI070edwKlFfZc9OAQmv WpvcE/pKGVhEONikBVTZJFui8yf+byKt8TLzwJmDisTyBAGLk4BmIiAOyPDi9vFUXNOK977/3bv bgO/hA8Jn9xM2nndrs65VmnrLd2eyPC/nNmm/sv/RdKr465NrD6mf9mu25zN9nhrxpqgxNTbt29 xAwA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 After the first patch of this series, the initial ID0 address is present in the local addr list when the connection has been created. Not to change the previous behaviour, but also to have a similar behaviour than what is done with the in-kernel PM, the initial ID0 address is not dumped with the rest. If the address is removed, then re-added later with a new subflow, it can be dumped. Fixes: 34e74a5cf3b7 ("mptcp: implement mptcp_userspace_pm_dump_addr") Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/pm_userspace.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c index 9c7fab6a59bf..c4d5161eefa7 100644 --- a/net/mptcp/pm_userspace.c +++ b/net/mptcp/pm_userspace.c @@ -609,7 +609,9 @@ int mptcp_userspace_pm_dump_addr(struct sk_buff *msg, lock_sock(sk); spin_lock_bh(&msk->pm.lock); mptcp_for_each_userspace_pm_addr(msk, entry) { - if (test_bit(entry->addr.id, bitmap->map)) + /* Ignore default ID0 & already sent */ + if ((entry->addr.id =3D=3D 0 && entry->flags =3D=3D 0) || + test_bit(entry->addr.id, bitmap->map)) continue; =20 if (mptcp_pm_genl_fill_addr(msg, cb, entry) < 0) --=20 2.53.0 From nobody Mon Aug 24 11:09:59 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 2A5BE42D74E for ; Mon, 27 Jul 2026 17:22:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785172938; cv=none; b=o7ugbhbu+0NWA4YrE5mBBC7xeuKRdvowB9qROhU79hYMU8kSVw1dlk3s/6qEGAp7e8vWKciuXQO0jVU7kBA5MxnOv8NL1BbGBLxGo82jjlCm3Zi+/Bc+K/0JWBJBk6IlTWp5IhqzzXIJl0lQxQta+4JefXKyEQA6j6K8yvN5Y/g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785172938; c=relaxed/simple; bh=1l2BrGr9D/QMBsvEatr2e8K8+KHsAP3MHOIJ7Ihr8S8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jkWtZyI4iIhGiey1oQ+hNHElgFdChauMnYkQAywJ8JH9lfLl0hdYAasYUUnHDjErAzUNciyFpcJkwoFI44xDUlGPPFFyV1kzQx0hXKHpwpSdD8Z0JFMMy6uziNXlf+09fO1cCmpDHRuwJNEfmtrh0SiHE7CWT8Uv8iW6h1qcwKc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=I4zmWUNr; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="I4zmWUNr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 712DF1F00A3E; Mon, 27 Jul 2026 17:22:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1785172933; bh=sHPVh6MsIT/s+4EMlZhmg8CEKL4NWWGYMsxIK5TzmKk=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=I4zmWUNrBot5vwTOJ5+yujBjD2lDMkRLwRkMg7uRJdbIzqSonf5idY6X7fbERvptr P87AlXV/WOedtdOYrMDAb3adX3C68UAkrcXGYChs83OvVF/g15f/CcPwRleVcoiaqn wW/dQ9jfJXkmZBNxfrI0u9JwGWdh63g/i5mYeub8yzrphUpk5pXzEQld/YoqXxb8vk pAxWjh2xQEqaHF3+CQtPtmit+be1wAKkJBdi/+utdsjcUig/22l8RrMoz5dFtF5St6 +YZIrC6Xhzof5v4C0WRy+Gwx8fia5SU5BGvMF9ATlJxWHr5i/yvaY6skLTLKuhcxuC jAg2AWwNnmfPQ== From: "Matthieu Baerts (NGI0)" Date: Mon, 27 Jul 2026 19:21:54 +0200 Subject: [PATCH mptcp-net 5/6] selftests: mptcp: join: new ID0 subflow from the right IP 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: <20260727-mptcp-pm-userspace-id0-case-v1-5-9877f02a9bae@kernel.org> References: <20260727-mptcp-pm-userspace-id0-case-v1-0-9877f02a9bae@kernel.org> In-Reply-To: <20260727-mptcp-pm-userspace-id0-case-v1-0-9877f02a9bae@kernel.org> To: MPTCP Linux Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2087; i=matttbe@kernel.org; h=from:subject:message-id; bh=1l2BrGr9D/QMBsvEatr2e8K8+KHsAP3MHOIJ7Ihr8S8=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGLLSJ++bWNOqf+sYg9XfhB2m6Q9Uwk3eqN2e3j/93plfi 6KXnDc70FHKwiDGxSArpsgi3RaZP/N5FW+Jl58FzBxWJpAhDFycAjCRO/8YGfZvVJX8ckH7pFp/ fUHasi+6XBW6Kn9VT/qKzgsuLP12+C3D/0S3Ekb/V52yzO0KvkxXZT6kB7JLNG38UDbXdP81B78 iPgA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 In MPTCP, the local address and port used by the initial subflow has the ID "0". It means that when this address and port are used for some operations -- e.g. creating a new subflow -- they should be linked to the ID0, and no other addresses and ports can get this special ID while the initial IP address and port is used. Hence, this is not correct here to try to create a subflow with the ID "0", but from a different IP address. With the first patch of this series, this action now returns an error. Instead of simply using the right IP address, continue to also use the wrong one to check that the kernel is correctly not allowing the creation of an ID0 subflow with the wrong IP address. While at it, fix the dumped address: the initial address is not supposed to be dumped, similar to what is being done with the in-kernel PM. So no "extra" addresses should be printed there. Fixes: b2e2248f365a ("selftests: mptcp: userspace pm create id 0 subflow") Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 7 ++++--- 1 file changed, 4 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 2413c832af03..0dc81eeb0636 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -4143,10 +4143,11 @@ userspace_tests() wait_event ns2 MPTCP_LIB_EVENT_ESTABLISHED 1 chk_mptcp_info subflows 0 subflows 0 chk_subflows_total 1 1 - userspace_pm_add_sf $ns2 10.0.3.2 0 + # from an IP not linked to ID0: failure expected, no new MPJ + userspace_pm_add_sf $ns2 10.0.3.2 0 2>/dev/null + userspace_pm_add_sf $ns2 10.0.1.2 0 wait_event ns2 MPTCP_LIB_EVENT_SUB_ESTABLISHED 1 - userspace_pm_chk_dump_addr "${ns2}" \ - "id 0 flags subflow 10.0.3.2" "id 0 subflow" + userspace_pm_chk_dump_addr "${ns2}" "" "id 0 subflow" chk_join_nr 1 1 1 chk_mptcp_info subflows 1 subflows 1 chk_subflows_total 2 2 --=20 2.53.0 From nobody Mon Aug 24 11:09:59 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 E0FEA422542 for ; Mon, 27 Jul 2026 17:22:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785172937; cv=none; b=tTUY/66DBWTE0eOM8AUee42VewqnGMgMUDLf6xeuZwCkC4rM2F+8jZGxUMdVdFYIxblsOGkFmf4mH1e9Yb+pRj5lsZ6Wgvjzh1IJMHA2soaRT429q2027dXXCV/viINGMBi1tz7DuMXjERLHGxcznwrcy5q7d0LhterGJAaiISw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785172937; c=relaxed/simple; bh=HK9L+6tl3LujYYtnelP5O+OSxu6zrrP1LJK/5MtqHoM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=usRTblsfDBMXsELZyxGwp9GxUEpPZLErVYwS03sbCIhuA5Rd3qCSld+9nXiu6CnAZ13X0ZxhUGPO5G80S8cpPmjLurqfotLHyUB9RApC9pVxU6xw4Evi16zYOAkO7hlIWvX/l5HAP28XoVFrZV7VdZEyunoQ3uLaZeyoE0d174s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=X6TLxPct; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="X6TLxPct" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43F661F00A3F; Mon, 27 Jul 2026 17:22:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1785172934; bh=wxqlRLSfsSsYWTiI1qlo0C2/ebcerc8vCmW30va7YjQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=X6TLxPctnK8hzVpSoXxcUt2PF0O3/1g4iWvzWkhK9f7s32qMcDh9pGkodVRlHDJih IXX02fLoRdNSOxUKKawdeaPAKyHGufULeJmpiFniMJ6u75sVqAWOceq4OVOw9HNBaJ uFpMxTZ9zWQMkl9LUIQ2B8pAoSuo5UfJZo3gdG4sPwDuCaLrHj0WqNkfJ4VPmM+nMa ZpzMASGgfoc6wsmuq4BY9sE4bycoRK+IaLtqwfy2RuH/fKrCmenvvd89z89n4IdpYo be64OGsPTe+OASeu1+GEDh3zZ3UqDftIoM/jOBDJI5BSvbqF/XkeL/Z3LwP2t4CCv8 3A+UFgpwBEN+g== From: "Matthieu Baerts (NGI0)" Date: Mon, 27 Jul 2026 19:21:55 +0200 Subject: [PATCH mptcp-net 6/6] mptcp: pm: restrict in-kernel worker actions to this PM 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: <20260727-mptcp-pm-userspace-id0-case-v1-6-9877f02a9bae@kernel.org> References: <20260727-mptcp-pm-userspace-id0-case-v1-0-9877f02a9bae@kernel.org> In-Reply-To: <20260727-mptcp-pm-userspace-id0-case-v1-0-9877f02a9bae@kernel.org> To: MPTCP Linux Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=713; i=matttbe@kernel.org; h=from:subject:message-id; bh=HK9L+6tl3LujYYtnelP5O+OSxu6zrrP1LJK/5MtqHoM=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGLLSJx84x8+lfdz82bI9k/tlI9vq8hw+vl20oOPow7w7f 4JW7Ezt7yhlYRDjYpAVU2SRbovMn/m8irfEy88CZg4rE8gQBi5OAZjIoQUM/+Pn3VaeuqTxlNiP CQtL3F0jNHhvPmOM31PKLzn5ecbm8/8Y/iceVT96k3PWZMNfJmbr5TrctiZ83fhPSeZI9vxJv/z ebuEBAA== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 No need to check them for the userspace PM. Fixes: a49eb8ae95b8 ("mptcp: pm: worker: split in-kernel and common tasks") Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/pm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c index 8421048f1a20..9bb2da3956b9 100644 --- a/net/mptcp/pm.c +++ b/net/mptcp/pm.c @@ -1138,7 +1138,9 @@ void mptcp_pm_worker(struct mptcp_sock *msk) pm->status &=3D ~BIT(MPTCP_PM_RM_ADDR_RECEIVED); mptcp_pm_rm_addr_recv(msk); } - __mptcp_pm_kernel_worker(msk); + + if (mptcp_pm_is_kernel(msk)) + __mptcp_pm_kernel_worker(msk); =20 spin_unlock_bh(&msk->pm.lock); } --=20 2.53.0