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 E4FF233CD2; Wed, 7 Aug 2024 15:16:11 +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=1723043772; cv=none; b=kH0sV82mWpBR9yAIvglbNBmPiXbftgPc26dNK+pIAvsBcWsQQYrRfaFxjqac1fm2IVW6lOJyRTHYGU6tbgCSSBE+DwaUHoLGuIyCMyKfeWYJgMC0aCr7FnCM1LTY9GqVr+PJFi71ngTpWRMC1x46+r1wQqzFG6wIFxDxDV1u/ik= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723043772; c=relaxed/simple; bh=MaFW/eCFusasbPoRLoI81YbOqOXz/L7x6BhUeKI5SZ4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rbfhBtmYQi2OSxi2wMb0yJQQiVqE9ZFC0dID1cnWKguFUjpACD3jOoOypP3hvU8ahg7yKSqgz9CwjRaOUK2C1/HasmJqI465pzddwbo52llyZiBVGsi57MOOjFYy8luzEK7gYaO2wvZzATS73Ul/FtopD7V55+1+YeDrXNLX4XY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=HTiaN10w; 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="HTiaN10w" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6FC9CC32781; Wed, 7 Aug 2024 15:16:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1723043771; bh=MaFW/eCFusasbPoRLoI81YbOqOXz/L7x6BhUeKI5SZ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HTiaN10w0E0XVM+/fN5tMPpmYSstle4ZUW7IoocQBdI6AtjSB4fKvEtfo0+2r//Xy LIDC/8fCqg0U8yjyShu42R3F7OsWCD9BdVHcA5PnXMzHcN5P8T76DBO+nQ1ROupLOg dUdn221m8fVZ49+OuFejvaTKMO2qm2pMYPfhelBo= 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.1 82/86] mptcp: fix NL PM announced address accounting Date: Wed, 7 Aug 2024 17:01:01 +0200 Message-ID: <20240807150041.997428808@linuxfoundation.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240807150039.247123516@linuxfoundation.org> References: <20240807150039.247123516@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-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 @@ -1445,6 +1445,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); } @@ -1609,17 +1610,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); }