From nobody Sat Apr 11 11:24:17 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 BDE2B2E54B6; Tue, 7 Apr 2026 08:41:50 +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=1775551310; cv=none; b=ee19sgs5+dNkQrFGZK8OjhzEY/Y2QovkyRrEbgIPR06Bd87yI5ReApUqJPTl1l2ShOtt2NIrnAqWbdxNbcDHmVXCLVSYeuLvi58guCdHc5NByjD54UuBJVJ5xwpa2FYw3c56BdnNHSEVd8nmVdEp5VKaXvRLrZjCfposLfE8ME0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775551310; c=relaxed/simple; bh=OkmnU4nlM29hsuno8u3eVrPXqnKmdcFgOmY3skpbYp0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=RKOGbeDCKVz20ILMYHBjVVTCKFibd+gpSq4D84MbkFJasy51dyAMjGAH0Q++/B14RU2C4/1LxkquleUrLA6TENTq6liU97lwBwsNn/5+kWSDlAu0AikfCD0OGsFnhfSoK6qbkdZsyJ0QuQnYAb+1+f7MOWQ/2I8AaRqHx4yskI4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RlGkZPT3; 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="RlGkZPT3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E883C116C6; Tue, 7 Apr 2026 08:41:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775551310; bh=OkmnU4nlM29hsuno8u3eVrPXqnKmdcFgOmY3skpbYp0=; h=From:Date:Subject:To:Cc:From; b=RlGkZPT3MOvOTwIDArNY9EsdDfm4DUvjh+g3w2k1ABoYFsVrGfq7nVCHps1c427jO zcvZwstUzO1Xq13CPSG/nqBjhlkDVOcq6mahd3UQXU1ziv+3FbFhZre7mSTi/uj6Bh FvccoVO1gJf9altTaxrkx6wBuiyK2haLYvCuqUD7dU+D1UX6bBmPHi8W5njQmcpATm WkAyinWXkF/hwh3+CJqk6kuF0Ux7Oprnt5yNyxfFjchcMf8dVALUW3SYV8TIIrG7H3 s3Yij1JuHKkzSG4S3xJSXHnGhT462CI91wHqi7DhtWMB3VB5qfnVPd/lB4x/rKkDaR lBU6denhPZmLg== From: "Matthieu Baerts (NGI0)" Date: Tue, 07 Apr 2026 10:41:41 +0200 Subject: [PATCH net v2] Revert "mptcp: add needs_id for netlink appending addr" 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: <20260407-net-mptcp-revert-pm-needs-id-v2-1-7a25cbc324f8@kernel.org> X-B4-Tracking: v=1; b=H4sIAAAAAAAC/yWM0QrCMBAEf6XcswdpkIr+ivhg0o2e0BhyqQil/ +7VPs6wOwspqkDp0i1U8RGVdzbwh47i854fYBmNyTs/uKMbOKPxVFosbHPUxmUyh1FtyKmPIZy c79MZZIlSkeT7z1/JnnTbpc7hhdi2MK3rD0DTB7iFAAAA X-Change-ID: 20260406-net-mptcp-revert-pm-needs-id-f1cbb7021f9e To: Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, linux-kernel@vger.kernel.org, stable@vger.kernel.org, "Matthieu Baerts (NGI0)" X-Mailer: b4 0.15.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=3890; i=matttbe@kernel.org; h=from:subject:message-id; bh=OkmnU4nlM29hsuno8u3eVrPXqnKmdcFgOmY3skpbYp0=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDKvHPZ2eaH2Z06zMZ/qMRf2BRtYU1n+cD0ISnTTMz+lW cYQXarXUcrCIMbFICumyCLdFpk/83kVb4mXnwXMHFYmkCEMXJwCMBGLMIbfbPHlbkVzPER3MzxZ Lia2PDHy99XlUWoW4l67M1pzrmRWM/xmd76mwfw6d3f3p5XT5Vn4HAKFHrvKOPRtfXJ2ww8D7QW cAA== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 This commit was originally adding the ability to add MPTCP endpoints with ID 0 by accident. The in-kernel PM, handling MPTCP endpoints at the net namespace level, is not supposed to handle endpoints with such ID, because this ID 0 is reserved to the initial subflow, as mentioned in the MPTCPv1 protocol [1], a per-connection setting. Note that 'ip mptcp endpoint add id 0' stops early with an error, but other tools might still request the in-kernel PM to create MPTCP endpoints with this restricted ID 0. In other words, it was wrong to call the mptcp_pm_has_addr_attr_id helper to check whether the address ID attribute is set: if it was set to 0, a new MPTCP endpoint would be created with ID 0, which is not expected, and might cause various issues later. Fixes: 584f38942626 ("mptcp: add needs_id for netlink appending addr") Cc: stable@vger.kernel.org Link: https://datatracker.ietf.org/doc/html/rfc8684#section-3.2-9 [1] Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- v2: - The v1 has been sent to net-next with a different commit message: https://lore.kernel.org/20260403-net-next-mptcp-msg_eor-misc-v1-4-b0b33b= ea3fed@kernel.org --- net/mptcp/pm_kernel.c | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/net/mptcp/pm_kernel.c b/net/mptcp/pm_kernel.c index 82e59f9c6dd9..0ebf43be9939 100644 --- a/net/mptcp/pm_kernel.c +++ b/net/mptcp/pm_kernel.c @@ -720,7 +720,7 @@ static void __mptcp_pm_release_addr_entry(struct mptcp_= pm_addr_entry *entry) =20 static int mptcp_pm_nl_append_new_local_addr(struct pm_nl_pernet *pernet, struct mptcp_pm_addr_entry *entry, - bool needs_id, bool replace) + bool replace) { struct mptcp_pm_addr_entry *cur, *del_entry =3D NULL; int ret =3D -EINVAL; @@ -779,7 +779,7 @@ static int mptcp_pm_nl_append_new_local_addr(struct pm_= nl_pernet *pernet, } } =20 - if (!entry->addr.id && needs_id) { + if (!entry->addr.id) { find_next: entry->addr.id =3D find_next_zero_bit(pernet->id_bitmap, MPTCP_PM_MAX_ADDR_ID + 1, @@ -790,7 +790,7 @@ static int mptcp_pm_nl_append_new_local_addr(struct pm_= nl_pernet *pernet, } } =20 - if (!entry->addr.id && needs_id) + if (!entry->addr.id) goto out; =20 __set_bit(entry->addr.id, pernet->id_bitmap); @@ -923,7 +923,7 @@ int mptcp_pm_nl_get_local_id(struct mptcp_sock *msk, return -ENOMEM; =20 entry->addr.port =3D 0; - ret =3D mptcp_pm_nl_append_new_local_addr(pernet, entry, true, false); + ret =3D mptcp_pm_nl_append_new_local_addr(pernet, entry, false); if (ret < 0) kfree(entry); =20 @@ -977,18 +977,6 @@ static int mptcp_nl_add_subflow_or_signal_addr(struct = net *net, return 0; } =20 -static bool mptcp_pm_has_addr_attr_id(const struct nlattr *attr, - struct genl_info *info) -{ - struct nlattr *tb[MPTCP_PM_ADDR_ATTR_MAX + 1]; - - if (!nla_parse_nested_deprecated(tb, MPTCP_PM_ADDR_ATTR_MAX, attr, - mptcp_pm_address_nl_policy, info->extack) && - tb[MPTCP_PM_ADDR_ATTR_ID]) - return true; - return false; -} - /* Add an MPTCP endpoint */ int mptcp_pm_nl_add_addr_doit(struct sk_buff *skb, struct genl_info *info) { @@ -1037,9 +1025,7 @@ int mptcp_pm_nl_add_addr_doit(struct sk_buff *skb, st= ruct genl_info *info) goto out_free; } } - ret =3D mptcp_pm_nl_append_new_local_addr(pernet, entry, - !mptcp_pm_has_addr_attr_id(attr, info), - true); + ret =3D mptcp_pm_nl_append_new_local_addr(pernet, entry, true); if (ret < 0) { GENL_SET_ERR_MSG_FMT(info, "too many addresses or duplicate one: %d", re= t); goto out_free; --- base-commit: a9d4f4f6e65e0bf9bbddedecc84d67249991979c change-id: 20260406-net-mptcp-revert-pm-needs-id-f1cbb7021f9e Best regards, -- =20 Matthieu Baerts (NGI0)