All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
Cc: mptcp@lists.linux.dev
Subject: Re: [PATCH net 04/14] mptcp: pm: kernel: drop pending ADD_ADDR when removing ID0
Date: Tue, 25 Aug 2026 16:49:18 +0000	[thread overview]
Message-ID: <20260825164919.6240E1F00A3D@smtp.kernel.org> (raw)
In-Reply-To: <20260824-net-mptcp-misc-fixes-7-3-rc1-v1-4-a92309d121ca@kernel.org>

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:

New issues:
- [High] Hardcoded `anno_addr.port = 0` fails to cancel the pending `ADD_ADDR` if the ID 0 endpoint was configured with a specific port.

Pre-existing issues:
- [High] Canceling an `ADD_ADDR` fails to clear `MPTCP_ADD_ADDR_SIGNAL`, silently dropping `RM_ADDR` and erroneously transmitting a canceled `ADD_ADDR`.
- [High] Calling `sk_stop_timer_sync()` while holding `rcu_read_lock()` triggers a sleep-in-atomic bug on PREEMPT_RT kernels.
--

--- Patch [4]: [PATCH net 04/14] mptcp: pm: kernel: drop pending ADD_ADDR when removing ID0 ---
commit 8ec4a41a6bf3f96bdf00a1088430d4fcabb37f97
Author: Kalpan Jani <kalpan.jani@mpiricsoftware.com>

mptcp: pm: kernel: drop pending ADD_ADDR when removing ID0

The in-kernel MPTCP path manager can leave a stale ADD_ADDR announcement
entry alive when removing the id 0 endpoint. This happens because the id 0
removal path does not tear down pending announcements, unlike the non-zero
id path.

Cc: stable@vger.kernel.org
Reported-by: syzbot+55c2a5c871441261ed14@syzkaller.appspotmail.com
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/620
Suggested-by: Tao Cui <cuitao@kylinos.cn>
Signed-off-by: Kalpan Jani <kalpan.jani@mpiricsoftware.com>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>

> diff --git a/net/mptcp/pm_kernel.c b/net/mptcp/pm_kernel.c
> index 424f1a7f92482..1a77508132354 100644
> --- a/net/mptcp/pm_kernel.c
> +++ b/net/mptcp/pm_kernel.c
> @@ -1146,7 +1148,13 @@ static int mptcp_nl_remove_id_zero_address(struct net *net,
>  			goto next;
>  
>  		lock_sock(sk);
> +		/* Drop a possibly pending ADD_ADDR for this address. */
> +		anno_addr = msk_local;
> +		anno_addr.port = 0;

[Severity: High]
Does hardcoding the port to 0 here prevent mptcp_pm_announced_remove() from
finding the pending announcement if the ID 0 endpoint was configured with a
specific port?

If a signal endpoint matches the initial subflow's IP but has a non-zero
port, the PM maps it to ID 0 and stores it in anno_list with the non-zero
port. Because mptcp_pm_announced_remove() enforces strict port matching,
it seems it would fail to find the announcement, leaving a stale ADD_ADDR
timer that could trigger a WARN_ON_ONCE.

> +		announced = mptcp_pm_announced_remove(msk, &anno_addr);

[Severity: High]
This is a pre-existing issue, but does calling mptcp_pm_announced_remove()
trigger a sleep-in-atomic bug on PREEMPT_RT kernels?

In net/mptcp/pm.c:mptcp_pm_announced_del_timer(), which is called by
mptcp_pm_announced_remove(), there is a call to sk_stop_timer_sync()
inside an RCU read-side critical section:

mptcp_pm_announced_del_timer()
    rcu_read_lock();
    ...
    sk_stop_timer_sync(sk, &entry->timer);

On PREEMPT_RT, timer_delete_sync() can sleep, which is not allowed inside
an RCU critical section.

>  		spin_lock_bh(&msk->pm.lock);
> +		if (announced)
> +			msk->pm.add_addr_signaled--;
>  		mptcp_pm_remove_addr(msk, &list);

[Severity: High]
This is also a pre-existing issue, but does canceling an ADD_ADDR fail to
clear the signal bit, causing the RM_ADDR to be dropped here?

When mptcp_pm_announced_del_timer() deletes the timer and removes the entry,
it does not clear the corresponding BIT(MPTCP_ADD_ADDR_SIGNAL) in
msk->pm.addr_signal. 

Then, when mptcp_pm_remove_addr() is called, it checks if rm_addr is
non-zero (which it is, because the signal bit is still set):

mptcp_pm_remove_addr()
    if (rm_addr) {
        MPTCP_ADD_STATS(...);
        return -EINVAL;
    }

Would this cause the RM_ADDR request to be silently dropped, while
erroneously transmitting the canceled ADD_ADDR?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260824-net-mptcp-misc-fixes-7-3-rc1-v1-0-a92309d121ca@kernel.org?part=4

  reply	other threads:[~2026-08-25 16:49 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-24 16:48 [PATCH net 00/14] mptcp: misc fixes for v7.3-rc1 Matthieu Baerts (NGI0)
2026-08-24 16:48 ` [PATCH net 01/14] mptcp: do not reschedule the RTX timer for fallback sockets Matthieu Baerts (NGI0)
2026-08-25 16:49   ` sashiko-bot
2026-08-27 19:07   ` Jakub Kicinski
2026-08-28  6:35     ` Paolo Abeni
2026-08-24 16:48 ` [PATCH net 02/14] mptcp: subflow: no need to copy thmac during ulp_clone Matthieu Baerts (NGI0)
2026-08-27 19:07   ` Jakub Kicinski
2026-08-28  9:58     ` Matthieu Baerts
2026-08-24 16:48 ` [PATCH net 03/14] mptcp: syncookies: remember the request backup flag Matthieu Baerts (NGI0)
2026-08-24 16:48 ` [PATCH net 04/14] mptcp: pm: kernel: drop pending ADD_ADDR when removing ID0 Matthieu Baerts (NGI0)
2026-08-25 16:49   ` sashiko-bot [this message]
2026-08-27 19:07   ` Jakub Kicinski
2026-08-24 16:48 ` [PATCH net 05/14] mptcp: options: handle MPC data + csum reqd + no csum Matthieu Baerts (NGI0)
2026-08-27 19:07   ` Jakub Kicinski
2026-08-24 16:48 ` [PATCH net 06/14] selftests: mptcp: fix an UAF in mptcp_connect.c Matthieu Baerts (NGI0)
2026-08-24 16:48 ` [PATCH net 07/14] mptcp: pm: userspace: fix address ID overflow Matthieu Baerts (NGI0)
2026-08-25 16:49   ` sashiko-bot
2026-08-24 16:48 ` [PATCH net 08/14] mptcp: pm: reset retrans_time when ADD_ADDR entry is reused Matthieu Baerts (NGI0)
2026-08-27 19:07   ` Jakub Kicinski
2026-08-24 16:48 ` [PATCH net 09/14] mptcp: remove unneeded READ_ONCE() annotation Matthieu Baerts (NGI0)
2026-08-24 16:48 ` [PATCH net 10/14] selftests: mptcp: lib: dump nstat for the right test Matthieu Baerts (NGI0)
2026-08-24 16:48 ` [PATCH net 11/14] selftests: mptcp: lib: get counters " Matthieu Baerts (NGI0)
2026-08-24 16:48 ` [PATCH net 12/14] mptcp: options: fix uninit-value in mptcp_write_data_fin Matthieu Baerts (NGI0)
2026-08-24 16:48 ` [PATCH net 13/14] mptcp: being below memory limit is a likely() condition Matthieu Baerts (NGI0)
2026-08-24 16:48 ` [PATCH net 14/14] mptcp: avoid pruning for OoW data Matthieu Baerts (NGI0)

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=20260825164919.6240E1F00A3D@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=matttbe@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=sashiko-reviews@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.