From: Matthieu Baerts <matttbe@kernel.org>
To: MPTCP Linux <mptcp@lists.linux.dev>
Subject: Re: [PATCH mptcp-net 2/6] mptcp: pm: userspace: allow announcing ID0 addr
Date: Wed, 5 Aug 2026 18:43:29 +0200 [thread overview]
Message-ID: <ac1c48e0-de2f-4794-8661-b529e69e713e@kernel.org> (raw)
In-Reply-To: <20260727-mptcp-pm-userspace-id0-case-v1-2-9877f02a9bae@kernel.org>
Replying to Sashiko's review:
>> diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c
>> index 6e6eeda91ade0..4c96433590e36 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, struct genl_info *info)
>> if (err < 0)
>> goto announce_err;
>>
>> - if (addr_val.addr.id == 0) {
>> - NL_SET_ERR_MSG_ATTR(info->extack, addr, "invalid addr id");
>> - err = -EINVAL;
>> - goto announce_err;
>> - }
>> -
>
> If userspace deletes the initial subflow via MPTCP_PM_CMD_SUBFLOW_DESTROY,
> which removes the ID 0 entry from the local address list, can userspace then
> announce an arbitrary IP address with ID 0?
>
> Since the original ID 0 entry would be missing, it seems
> mptcp_userspace_pm_append_new_local_addr() wouldn't find an address or ID
> match:
>
> net/mptcp/pm_userspace.c:mptcp_userspace_pm_append_new_local_addr() {
> ...
> if (!addr_match && !id_match) {
> ...
> list_add_tail_rcu(&e->list, &msk->pm.userspace_pm_local_addr_list);
> msk->pm.local_addr_used++;
> ret = e->addr.id;
> }
> ...
> }
>
> Would this incorrectly append a new entry with ID 0 and an arbitrary IP
> address, bypassing the validation mentioned in the commit message?
Yes, but the RFC8684 doesn't specify if the ID0 can be replaced by
another address, once removed. But it says: "A host wishing to replace
an existing Address ID MUST first remove the existing one". In this
condition, better to let the responsibility to the userspace daemon.
I can add a note in the commit message.
> Does allowing ID 0 announcements here also create a state inconsistency when
> trying to remove them?
>
> Looking at mptcp_pm_nl_remove_doit(), there is a hardcoded fast path for ID 0:
>
> net/mptcp/pm_userspace.c:mptcp_pm_nl_remove_doit() {
> ...
> if (id_val == 0) {
> err = mptcp_userspace_pm_remove_id_zero_address(msk);
> goto out;
> }
> ...
> }
>
> Because mptcp_userspace_pm_remove_id_zero_address() doesn't call
> mptcp_pm_announced_remove() and ignores msk->pm.anno_list, would this
> leave the announcement un-cancellable and leak the state in anno_list?
Removed in the next patch.
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
next prev parent reply other threads:[~2026-08-05 16:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-27 17:21 [PATCH mptcp-net 0/6] mptcp: pm: userspace: properly deal with the ID0 case Matthieu Baerts (NGI0)
2026-07-27 17:21 ` [PATCH mptcp-net 1/6] mptcp: pm: userspace: properly handle " Matthieu Baerts (NGI0)
2026-08-05 16:43 ` Matthieu Baerts
2026-07-27 17:21 ` [PATCH mptcp-net 2/6] mptcp: pm: userspace: allow announcing ID0 addr Matthieu Baerts (NGI0)
2026-08-05 16:43 ` Matthieu Baerts [this message]
2026-07-27 17:21 ` [PATCH mptcp-net 3/6] mptcp: pm: userspace: no ID0 exception for RM_ADDR Matthieu Baerts (NGI0)
2026-08-05 16:43 ` Matthieu Baerts
2026-07-27 17:21 ` [PATCH mptcp-net 4/6] mptcp: pm: userspace: don't dump initial ID0 Matthieu Baerts (NGI0)
2026-07-27 17:21 ` [PATCH mptcp-net 5/6] selftests: mptcp: join: new ID0 subflow from the right IP Matthieu Baerts (NGI0)
2026-07-27 17:21 ` [PATCH mptcp-net 6/6] mptcp: pm: restrict in-kernel worker actions to this PM Matthieu Baerts (NGI0)
2026-07-27 19:10 ` [PATCH mptcp-net 0/6] mptcp: pm: userspace: properly deal with the ID0 case MPTCP CI
2026-08-01 0:06 ` Mat Martineau
2026-08-05 16:42 ` Matthieu Baerts
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ac1c48e0-de2f-4794-8661-b529e69e713e@kernel.org \
--to=matttbe@kernel.org \
--cc=mptcp@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox