From nobody Sun Dec 22 01:44:58 2024 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 DBF1E1CC8A9; Tue, 19 Nov 2024 13:02:58 +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=1732021379; cv=none; b=I4fSLy0QSkY/zraPQ5uPxcvFQkMgE9L01MGgaMQ0FvXtuP4nbLEcp5AGqwWW8AO2uvF07CHsgGi2ZCgAEShwuksBaxvX4/10RxQmMqbxfEZNQsPdtZWu7WlBHJ8OLxfVtdhAJFvcBFFdMkCA3E9392SDdctDHwVTg6bjH4UvuQY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732021379; c=relaxed/simple; bh=IeU4eWbVZB280GviGOWrTDYBtffKC+yiQKQ/FLABVK4=; h=Subject:To:Cc:From:Date:In-Reply-To:Message-ID:MIME-Version: Content-Type; b=lvIhhxNQSmKp8W7dMXtbWhLMOncUm9jy2o6PJSJBFWaEoReI2IdnvUbiZZt9pJt1rUWM4fF5nOa7WWvG8pJGKRzOAv5MhoohkutJwM04ZvEceO3C35fuK0BhJsnoXBczJCoLgfKoBm+uObl6nMkP0NF0CtZ9L7752r4DK4OrTyA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=notXcQ11; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="notXcQ11" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 61CFFC4CECF; Tue, 19 Nov 2024 13:02:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1732021378; bh=IeU4eWbVZB280GviGOWrTDYBtffKC+yiQKQ/FLABVK4=; h=Subject:To:Cc:From:Date:In-Reply-To:From; b=notXcQ115cnAjo66U8ZCx5OAYj/jFmd+K6F9+X+DlPt3Yh72jfgoiWIuBkRR1uH1e 1/RuWi8ssdzMA3BHnSsNID0EsGm0MUN/QqEqBXv7x43ZDEKn4tUqTdrKjYiM9FrZZ3 NGvgSYuzf1sTAw+T5IO/jop8Hyvf7abwrSadItKI= Subject: Patch "mptcp: add userspace_pm_lookup_addr_by_id helper" has been added to the 6.6-stable tree To: davem@davemloft.net,gregkh@linuxfoundation.org,martineau@kernel.org,matttbe@kernel.org,mptcp@lists.linux.dev,sashal@kernel.org,tanggeliang@kylinos.cn Cc: From: Date: Tue, 19 Nov 2024 14:02:34 +0100 In-Reply-To: <20241118182718.3011097-10-matttbe@kernel.org> Message-ID: <2024111934-impatient-bouncy-cc04@gregkh> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-stable: commit X-Patchwork-Hint: ignore Content-Type: text/plain; charset="utf-8" This is a note to let you know that I've just added the patch titled mptcp: add userspace_pm_lookup_addr_by_id helper to the 6.6-stable tree which can be found at: http://www.kernel.org/git/?p=3Dlinux/kernel/git/stable/stable-queue.git= ;a=3Dsummary The filename of the patch is: mptcp-add-userspace_pm_lookup_addr_by_id-helper.patch and it can be found in the queue-6.6 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. From stable+bounces-93823-greg=3Dkroah.com@vger.kernel.org Mon Nov 18 19:27= :51 2024 From: "Matthieu Baerts (NGI0)" Date: Mon, 18 Nov 2024 19:27:20 +0100 Subject: mptcp: add userspace_pm_lookup_addr_by_id helper To: mptcp@lists.linux.dev, stable@vger.kernel.org, gregkh@linuxfoundation.o= rg Cc: Geliang Tang , sashal@kernel.org, Matthieu Baer= ts , Mat Martineau , "David S . M= iller" Message-ID: <20241118182718.3011097-10-matttbe@kernel.org> From: Geliang Tang commit 06afe09091ee69dc7ab058b4be9917ae59cc81e5 upstream. Corresponding __lookup_addr_by_id() helper in the in-kernel netlink PM, this patch adds a new helper mptcp_userspace_pm_lookup_addr_by_id() to lookup the address entry with the given id on the userspace pm local address list. Signed-off-by: Geliang Tang Reviewed-by: Matthieu Baerts (NGI0) Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts (NGI0) Signed-off-by: David S. Miller Stable-dep-of: f642c5c4d528 ("mptcp: hold pm lock when deleting entry") Signed-off-by: Matthieu Baerts (NGI0) Signed-off-by: Greg Kroah-Hartman --- net/mptcp/pm_userspace.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) --- a/net/mptcp/pm_userspace.c +++ b/net/mptcp/pm_userspace.c @@ -107,19 +107,26 @@ static int mptcp_userspace_pm_delete_loc return -EINVAL; } =20 +static struct mptcp_pm_addr_entry * +mptcp_userspace_pm_lookup_addr_by_id(struct mptcp_sock *msk, unsigned int = id) +{ + struct mptcp_pm_addr_entry *entry; + + list_for_each_entry(entry, &msk->pm.userspace_pm_local_addr_list, list) { + if (entry->addr.id =3D=3D id) + return entry; + } + return NULL; +} + int mptcp_userspace_pm_get_flags_and_ifindex_by_id(struct mptcp_sock *msk, unsigned int id, u8 *flags, int *ifindex) { - struct mptcp_pm_addr_entry *entry, *match =3D NULL; + struct mptcp_pm_addr_entry *match; =20 spin_lock_bh(&msk->pm.lock); - list_for_each_entry(entry, &msk->pm.userspace_pm_local_addr_list, list) { - if (id =3D=3D entry->addr.id) { - match =3D entry; - break; - } - } + match =3D mptcp_userspace_pm_lookup_addr_by_id(msk, id); spin_unlock_bh(&msk->pm.lock); if (match) { *flags =3D match->flags; @@ -280,7 +287,7 @@ int mptcp_nl_cmd_remove(struct sk_buff * { struct nlattr *token =3D info->attrs[MPTCP_PM_ATTR_TOKEN]; struct nlattr *id =3D info->attrs[MPTCP_PM_ATTR_LOC_ID]; - struct mptcp_pm_addr_entry *match =3D NULL; + struct mptcp_pm_addr_entry *match; struct mptcp_pm_addr_entry *entry; struct mptcp_sock *msk; LIST_HEAD(free_list); @@ -317,13 +324,7 @@ int mptcp_nl_cmd_remove(struct sk_buff * =20 lock_sock(sk); =20 - list_for_each_entry(entry, &msk->pm.userspace_pm_local_addr_list, list) { - if (entry->addr.id =3D=3D id_val) { - match =3D entry; - break; - } - } - + match =3D mptcp_userspace_pm_lookup_addr_by_id(msk, id_val); if (!match) { GENL_SET_ERR_MSG(info, "address with specified id not found"); release_sock(sk); Patches currently in stable-queue which might be from matttbe@kernel.org are queue-6.6/mptcp-pm-use-_rcu-variant-under-rcu_read_lock.patch queue-6.6/mptcp-error-out-earlier-on-disconnect.patch queue-6.6/mptcp-hold-pm-lock-when-deleting-entry.patch queue-6.6/mptcp-cope-racing-subflow-creation-in-mptcp_rcv_spac.patch queue-6.6/mptcp-drop-lookup_by_id-in-lookup_addr.patch queue-6.6/mptcp-add-userspace_pm_lookup_addr_by_id-helper.patch queue-6.6/mptcp-define-more-local-variables-sk.patch queue-6.6/mptcp-update-local-address-flags-when-setting-it.patch