From mboxrd@z Thu Jan 1 00:00:00 1970 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 E59E381AB1; Wed, 7 Aug 2024 15:12:01 +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=1723043522; cv=none; b=Ny3o0teFWOm+9D7D5iQlwZc5nR2hJEEfMIq1l+T05ZWOAkl92obgNVVg3+88HDnLrWFgnLxMi4euw76jmvEurxo3PxX0D1eYhIIjL2FX0gckTn7hoRsLZdo1BEAr7HNhf4sHvp1T4ZRZjgHnQrEltvAmn6XFkb0xjIXx1G1iWGs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723043522; c=relaxed/simple; bh=EK4euiygNhTgwEr1p9gatG6+lljNMMzjSl8UgdrBu+A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BJ8jJgUXqKGbYHLEQlK1Q7e/Cq5uUyrcwUB1uI4vYFfhiPMkP27EFsdKO7/mRhp/lcnkS/an+xYwRubw95NdfZqfzF6xGIArEf0zGjtTxpqmKhL9JCCs4Xy6BwJ6C6fDojW3eJXkcNCIRtGNsscNxRpihuw+XtdOblbkpiEn7/g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=UvKiwY1p; 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="UvKiwY1p" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F2E9C32781; Wed, 7 Aug 2024 15:12:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1723043521; bh=EK4euiygNhTgwEr1p9gatG6+lljNMMzjSl8UgdrBu+A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UvKiwY1pLd0hZGhfMOBehBdmEs3jax5Xj6rKw48OZZ5EX8pXsqkEb6LNBpjy/aV6Y bPP2KBGyJ3PW9BJGzhC5823rEEbJZ9yHncVxwImx+A/e/u3UnRWBCB9SaVYY7tDV9g hzfQszqIU4BDxYX0B1XmmBfxAp5OrkeO5LzMlLoY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Paolo Abeni , "Matthieu Baerts (NGI0)" , "David S. Miller" Subject: [PATCH 6.6 113/121] mptcp: fix NL PM announced address accounting Date: Wed, 7 Aug 2024 17:00:45 +0200 Message-ID: <20240807150023.107186509@linuxfoundation.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240807150019.412911622@linuxfoundation.org> References: <20240807150019.412911622@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Paolo Abeni commit 4b317e0eb287bd30a1b329513531157c25e8b692 upstream. Currently the per connection announced address counter is never decreased. As a consequence, after connection establishment, if the NL PM deletes an endpoint and adds a new/different one, no additional subflow is created for the new endpoint even if the current limits allow that. Address the issue properly updating the signaled address counter every time the NL PM removes such addresses. Fixes: 01cacb00b35c ("mptcp: add netlink-based PM") Cc: stable@vger.kernel.org Signed-off-by: Paolo Abeni Reviewed-by: Matthieu Baerts (NGI0) Signed-off-by: Matthieu Baerts (NGI0) Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/mptcp/pm_netlink.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -1432,6 +1432,7 @@ static bool mptcp_pm_remove_anno_addr(st ret = remove_anno_list_by_saddr(msk, addr); if (ret || force) { spin_lock_bh(&msk->pm.lock); + msk->pm.add_addr_signaled -= ret; mptcp_pm_remove_addr(msk, &list); spin_unlock_bh(&msk->pm.lock); } @@ -1596,17 +1597,18 @@ void mptcp_pm_remove_addrs_and_subflows( struct mptcp_pm_addr_entry *entry; list_for_each_entry(entry, rm_list, list) { - if (lookup_subflow_by_saddr(&msk->conn_list, &entry->addr) && - slist.nr < MPTCP_RM_IDS_MAX) + if (slist.nr < MPTCP_RM_IDS_MAX && + lookup_subflow_by_saddr(&msk->conn_list, &entry->addr)) slist.ids[slist.nr++] = entry->addr.id; - if (remove_anno_list_by_saddr(msk, &entry->addr) && - alist.nr < MPTCP_RM_IDS_MAX) + if (alist.nr < MPTCP_RM_IDS_MAX && + remove_anno_list_by_saddr(msk, &entry->addr)) alist.ids[alist.nr++] = entry->addr.id; } if (alist.nr) { spin_lock_bh(&msk->pm.lock); + msk->pm.add_addr_signaled -= alist.nr; mptcp_pm_remove_addr(msk, &alist); spin_unlock_bh(&msk->pm.lock); }