From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 761F144AB61; Tue, 21 Jul 2026 21:25:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784669130; cv=none; b=OHGeG0i79IfYJrjCc6C9vwgeKvgajXYVN0C/mFfDfDSYM+5KY1orqf6+EcJoyimJms4lSKJE027QogzQg/T07Js5DqY8h5qqG/X7gxmZnYIYClLH4tClpZqe3LJbfEvdiVlPdWG2p9pGArVKqW2ychPGiMGfI60VnX1LhA4BV5c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784669130; c=relaxed/simple; bh=LLl6xePhiP9XxftLHKxxKfZeVZunHw7yGjHZ386OSG4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sgNUCAlGWfCWKuqm6tIS3Wide2tKXo5ZS4nIbUpZLLXRLnVQR7zlASdI1vpWz12IOpG37+dM9s+lkkUDThcTCPAHnDBXKE/6dfLAS2aXsx2zJP6oQOuWJf9xWjXAyGJw6JbFwrcfwG8l4Gbkl44GCXgX035Qd2ci+tqMakl2Ihs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1muaR4ra; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="1muaR4ra" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC1D11F000E9; Tue, 21 Jul 2026 21:25:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784669129; bh=rKpIDmoPQlcynP7ShnJHvB083zn0yK+YBt0eJDWVnGI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=1muaR4raeevXrZT9pJ0ujjsUHQAwUGbd4OFu3WjiU3AiYLQRsJyWN29xL4hTswW5b zJZVgeKoWfW9qbebdZzAkEJsxFPPRpCPnLWqnSXnVMMGJJZtFefgLKyBkmiT85JMdk DrMnNI1VdlJRPnvNVDRtraEXxaCkYTgWt5Xi96gU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Michael Bommarito , Tung Nguyen , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.1 0439/1067] tipc: reject inverted service ranges from peer bindings Date: Tue, 21 Jul 2026 17:17:20 +0200 Message-ID: <20260721152434.436957298@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152424.521567757@linuxfoundation.org> References: <20260721152424.521567757@linuxfoundation.org> User-Agent: quilt/0.69 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.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Michael Bommarito [ Upstream commit 2afb648f7b99216c687db1f89739c995e1144153 ] tipc_update_nametbl() inserts a binding advertised by a peer node using the lower and upper service-range bounds taken directly from the wire, without checking that lower <= upper. The local bind path validates the ordering (tipc_uaddr_valid()), but the name-distribution path does not. A binding with lower > upper is inserted at the far end of the service-range rbtree (keyed on lower) where no lookup or withdrawal can ever match it (service_range_foreach_match() requires sr->lower <= end). The publication, its service_range node and the augmented rbtree entry are then leaked for the lifetime of the namespace, and there is no per-peer cap equivalent to TIPC_MAX_PUBL on locally created bindings. Reject inverted ranges in the network path as well. A peer node can otherwise leak unbounded binding-table memory by sending PUBLICATION items with lower > upper. Fixes: 37922ea4a310 ("tipc: permit overlapping service ranges in name table") Signed-off-by: Michael Bommarito Reviewed-by: Tung Nguyen Link: https://patch.msgid.link/20260610124003.3831170-4-michael.bommarito@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/tipc/name_distr.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c index 190b49c5cbc3ec..ba4f4906e13b70 100644 --- a/net/tipc/name_distr.c +++ b/net/tipc/name_distr.c @@ -280,12 +280,21 @@ static bool tipc_update_nametbl(struct net *net, struct distr_item *i, u32 node, u32 dtype) { struct publication *p = NULL; + u32 lower = ntohl(i->lower); + u32 upper = ntohl(i->upper); struct tipc_socket_addr sk; - struct tipc_uaddr ua; u32 key = ntohl(i->key); + struct tipc_uaddr ua; + + /* A peer-advertised binding with lower > upper can never be matched + * or withdrawn and would leak the publication; the local bind path + * rejects such ranges, so reject ranges learned from the network too. + */ + if (lower > upper) + return false; tipc_uaddr(&ua, TIPC_SERVICE_RANGE, TIPC_CLUSTER_SCOPE, - ntohl(i->type), ntohl(i->lower), ntohl(i->upper)); + ntohl(i->type), lower, upper); sk.ref = ntohl(i->port); sk.node = node; -- 2.53.0