All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mat Martineau <martineau@kernel.org>
To: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
Cc: mptcp@lists.linux.dev, Paolo Abeni <pabeni@redhat.com>
Subject: Re: [PATCH mptcp-net v4 22/23] mptcp: pm: reuse ID 0 after delete and re-add
Date: Tue, 23 Jul 2024 15:02:17 -0700 (PDT)	[thread overview]
Message-ID: <d3350be8-c35c-d02a-fe77-c898f08c604b@kernel.org> (raw)
In-Reply-To: <20240722-mptcp-pm-avail-v4-22-15bfd73de384@kernel.org>

On Mon, 22 Jul 2024, Matthieu Baerts (NGI0) wrote:

> When the endpoint used by the initial subflow is removed and re-added
> later, the PM has to force the ID 0, it is a special case imposed by the
> MPTCP specs.
>
> Note that the endpoint should then need to be re-added reusing the same
> ID.
>
> Fixes: 3ad14f54bd74 ("mptcp: more accurate MPC endpoint tracking")
> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
> ---
> net/mptcp/pm_netlink.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
> index 8f25690a5edc..45a1aa0a40bf 100644
> --- a/net/mptcp/pm_netlink.c
> +++ b/net/mptcp/pm_netlink.c
> @@ -586,6 +586,11 @@ static void mptcp_pm_create_subflow_or_signal_addr(struct mptcp_sock *msk)
>
> 		__clear_bit(local.addr.id, msk->pm.id_avail_bitmap);
> 		msk->pm.add_addr_signaled++;
> +
> +		/* Special case for ID0: set the correct */

"set the correct ID" ?

> +		if (local.addr.id == msk->mpc_endpoint_id)
> +			local.addr.id = 0;
> +
> 		mptcp_pm_announce_addr(msk, &local.addr, false);
> 		mptcp_pm_nl_addr_send_ack(msk);
>
> @@ -614,6 +619,10 @@ static void mptcp_pm_create_subflow_or_signal_addr(struct mptcp_sock *msk)
> 		if (nr == 0)
> 			continue;
>
> +		/* Special case for ID0: set the correct ID */
> +		if (local.addr.id == msk->mpc_endpoint_id)
> +			local.addr.id = 0;
> +
> 		spin_unlock_bh(&msk->pm.lock);
> 		for (i = 0; i < nr; i++)
> 			__mptcp_subflow_connect(sk, &local.addr, &addrs[i]);
>
> -- 
> 2.45.2
>
>
>

  reply	other threads:[~2024-07-23 22:02 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-22 19:35 [PATCH mptcp-net v4 00/23] mptcp: fix endpoints with 'signal' and 'subflow' flags Matthieu Baerts (NGI0)
2024-07-22 19:35 ` [PATCH mptcp-net v4 01/23] mptcp: fully established after ADD_ADDR echo on MPJ Matthieu Baerts (NGI0)
2024-07-22 19:35 ` [PATCH mptcp-net v4 02/23] mptcp: pm: deny endp with signal + subflow + port Matthieu Baerts (NGI0)
2024-07-22 19:35 ` [PATCH mptcp-net v4 03/23] mptcp: pm: reduce indentation blocks Matthieu Baerts (NGI0)
2024-07-22 19:35 ` [PATCH mptcp-net v4 04/23] mptcp: pm: don't try to create sf if alloc failed Matthieu Baerts (NGI0)
2024-07-22 19:35 ` [PATCH mptcp-net v4 05/23] mptcp: pm: do not ignore 'subflow' if 'signal' flag is also set Matthieu Baerts (NGI0)
2024-07-22 19:35 ` [PATCH mptcp-net v4 06/23] selftests: mptcp: join: ability to invert ADD_ADDR check Matthieu Baerts (NGI0)
2024-07-22 19:35 ` [PATCH mptcp-net v4 07/23] selftests: mptcp: join: test both signal & subflow Matthieu Baerts (NGI0)
2024-07-22 19:35 ` [PATCH mptcp-net v4 08/23] mptcp: pm: re-using ID of unused removed ADD_ADDR Matthieu Baerts (NGI0)
2024-07-22 19:35 ` [PATCH mptcp-net v4 09/23] selftests: mptcp: join: check re-using ID of unused ADD_ADDR Matthieu Baerts (NGI0)
2024-07-22 19:35 ` [PATCH mptcp-net v4 10/23] mptcp: pm: re-using ID of unused removed subflows Matthieu Baerts (NGI0)
2024-07-22 19:35 ` [PATCH mptcp-net v4 11/23] selftests: mptcp: join: check re-using ID of closed subflow Matthieu Baerts (NGI0)
2024-07-24 17:14   ` Mat Martineau
2024-07-26 10:38     ` Matthieu Baerts
2024-07-22 19:35 ` [PATCH mptcp-net v4 12/23] mptcp: pm: re-using ID of unused flushed subflows Matthieu Baerts (NGI0)
2024-07-23 22:00   ` Mat Martineau
2024-07-22 19:35 ` [PATCH mptcp-net v4 13/23] selftests: mptcp: join: test for flush/re-add endpoints Matthieu Baerts (NGI0)
2024-07-22 19:35 ` [PATCH mptcp-net v4 14/23] mptcp: pm: remove mptcp_pm_remove_subflow() Matthieu Baerts (NGI0)
2024-07-22 19:35 ` [PATCH mptcp-net v4 15/23] mptcp: pm: only mark 'subflow' endp as available Matthieu Baerts (NGI0)
2024-07-22 19:35 ` [PATCH mptcp-net v4 16/23] mptcp: pm: only decrement add_addr_accepted for MPJ req Matthieu Baerts (NGI0)
2024-07-22 19:35 ` [PATCH mptcp-net v4 17/23] mptcp: pm: check add_addr_accept_max before accepting new ADD_ADDR Matthieu Baerts (NGI0)
2024-07-22 19:35 ` [PATCH mptcp-net v4 18/23] mptcp: pm: only in-kernel cannot have entries with ID 0 Matthieu Baerts (NGI0)
2024-07-22 19:35 ` [PATCH mptcp-net v4 19/23] mptcp: pm: fullmesh: select the right ID later Matthieu Baerts (NGI0)
2024-07-22 19:35 ` [PATCH mptcp-net v4 20/23] selftests: mptcp: join: validate fullmesh endp on 1st sf Matthieu Baerts (NGI0)
2024-07-22 19:35 ` [PATCH mptcp-net v4 21/23] mptcp: pm: avoid possible UaF whend selecting endp Matthieu Baerts (NGI0)
2024-07-23 22:01   ` Mat Martineau
2024-07-25 15:43   ` Paolo Abeni
2024-07-22 19:36 ` [PATCH mptcp-net v4 22/23] mptcp: pm: reuse ID 0 after delete and re-add Matthieu Baerts (NGI0)
2024-07-23 22:02   ` Mat Martineau [this message]
2024-07-22 19:36 ` [PATCH mptcp-net v4 23/23] mptcp: pm: reduce entries iterations on connect Matthieu Baerts (NGI0)
2024-07-23  2:56   ` kernel test robot
2024-07-23  5:52   ` kernel test robot
2024-07-23 10:19   ` Matthieu Baerts
2024-07-22 20:32 ` [PATCH mptcp-net v4 00/23] mptcp: fix endpoints with 'signal' and 'subflow' flags MPTCP CI
2024-07-23 22:04 ` Mat Martineau

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=d3350be8-c35c-d02a-fe77-c898f08c604b@kernel.org \
    --to=martineau@kernel.org \
    --cc=matttbe@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=pabeni@redhat.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 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.