From: Matthieu Baerts <matttbe@kernel.org>
To: Paolo Abeni <pabeni@redhat.com>
Cc: syzbot+cd16e79c1e45f3fe0377@syzkaller.appspotmail.com,
mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-net] mptcp: pm: only set fullmesh for subflow endp
Date: Thu, 16 Jan 2025 20:47:52 +0100 [thread overview]
Message-ID: <d4556501-80c9-4e1a-a1f8-15383860eea5@kernel.org> (raw)
In-Reply-To: <e2a7532a-ec79-4d09-ba45-55bda7e60092@redhat.com>
Hi Paolo,
On 16/01/2025 19:37, Paolo Abeni wrote:
> On 1/16/25 7:15 PM, Matthieu Baerts (NGI0) wrote:
>> With the in-kernel path-manager, it is possible to change the 'fullmesh'
>> flag. The code in mptcp_pm_nl_fullmesh() expects to change it only on
>> 'subflow' endpoints, to recreate more or less subflows using the linked
>> address.
>>
>> Unfortunately, the set_flags() hook was a bit more permissive, and
>> allowed 'implicit' endpoints to get the 'fullmesh' flag while it is not
>> allowed before.
>>
>> That's what syzbot found, triggering the following warning:
(...)
>> Fixes: 73c762c1f07d ("mptcp: set fullmesh flag in pm_netlink")
>> Reported-by: syzbot+cd16e79c1e45f3fe0377@syzkaller.appspotmail.com
>> Closes: https://lore.kernel.org/6786ac51.050a0220.216c54.00a6.GAE@google.com
>> Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/540
>> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
>> ---
>> net/mptcp/pm_netlink.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
>> index fef01692eaed404e272359df691264f797240d10..7131dc2f312d923a31bb4b0460b6b4663376fbd0 100644
>> --- a/net/mptcp/pm_netlink.c
>> +++ b/net/mptcp/pm_netlink.c
>> @@ -1986,7 +1986,8 @@ int mptcp_pm_nl_set_flags(struct mptcp_pm_addr_entry *local,
>> return -EINVAL;
>> }
>> if ((local->flags & MPTCP_PM_ADDR_FLAG_FULLMESH) &&
>> - (entry->flags & MPTCP_PM_ADDR_FLAG_SIGNAL)) {
>> + ((entry->flags & MPTCP_PM_ADDR_FLAG_SIGNAL) ||
>> + (entry->flags & MPTCP_PM_ADDR_FLAG_IMPLICIT))) {
>> spin_unlock_bh(&pernet->lock);
>> NL_SET_ERR_MSG_ATTR(info->extack, attr, "invalid addr flags");
>> return -EINVAL;
>
> LGTM, thanks!
>
> slight preference for:
>
> entry->flags & (MPTCP_PM_ADDR_FLAG_SIGNAL ||
> MPTCP_PM_ADDR_FLAG_IMPLICIT)
>
> but definitely not strong opinion about it.
Good point! I agree with you. That was in fact my v2, then I switched to
a version with:
flags & (SUBFLOW | SIGNAL | IMPLICIT) == SUBFLOW
but then I realised the case with no "type" (so not subflow, signal nor
implicit) was OK in fact, even if it will recreate the subflows for no
reasons, but that was already the case before.
So I switched back to v1, and forgot about v2 :)
Can I add your Acked-by or you prefer not to?
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
next prev parent reply other threads:[~2025-01-16 19:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-16 18:15 [PATCH mptcp-net] mptcp: pm: only set fullmesh for subflow endp Matthieu Baerts (NGI0)
2025-01-16 18:37 ` Paolo Abeni
2025-01-16 19:47 ` Matthieu Baerts [this message]
2025-01-16 19:21 ` MPTCP CI
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=d4556501-80c9-4e1a-a1f8-15383860eea5@kernel.org \
--to=matttbe@kernel.org \
--cc=mptcp@lists.linux.dev \
--cc=pabeni@redhat.com \
--cc=syzbot+cd16e79c1e45f3fe0377@syzkaller.appspotmail.com \
/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