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 5FCFF3DD51A; Sat, 12 Sep 2026 19:13:47 +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=1789240428; cv=none; b=bMWNxYmJnjtB2hzPDyATxDHskZtUUJxZbonfQZ1INTqdsH+vP987wcWQd719tycYHgTiAZfzpn0BMQCQPoCb1kpx5RTXyax86aRpk2rH9QcKHb6yDZx/kYzj67+pvn45BYWZiiVmm7u883cHZLw7h/VVUobz2krvYTImrtMSi+M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789240428; c=relaxed/simple; bh=4jAW7p9ltDmcSpvRVxIswDqUarAEmQO0elV1Q6NwR3k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ma/jaEuV593BKpeYSO7V+qHRs6GaNhVPNgn1On/doK3DiCBFrNPo5TV6Us9Wq+3PfAMT23uBVpyDha9sQTATxv+4htpD2QxUja5kq4ihXEfVDVi9k9LOA/KZIQgGC8ePIrO7HMBhV7np/3H8BdwgXUTw3/DyEGOEs2C1XwvFDK8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=d/goy7mB; 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="d/goy7mB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62F031F000FF; Sat, 12 Sep 2026 19:13:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789240427; bh=M/4AEQGzmhJ7jCkbNdbhMWJKNM47vB3+ztGVsFzxd1U=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=d/goy7mBxMi3P8/HbGdC1HZ4tiuCLOLcCIAe4oemvhJOQ6T8KvNBSEI/W2wwQujhy Q9s5Zdo2KERo83QVM8GfwukIpRFfjFafNUszQlLNqpemfXdC9P3S9yRPjgue6AmnwO ffmDaf1lsa/DsA82C+/kOpsj2cby2frupAmPgtvw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ruoyu Wang , Nikolay Aleksandrov , "David S. Miller" , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.15 867/935] net: bridge: Reject descending VLAN tunnel ranges Date: Sat, 12 Sep 2026 09:04:57 +0200 Message-ID: <20260912065546.703946291@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065526.833703348@linuxfoundation.org> References: <20260912065526.833703348@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 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ruoyu Wang [ Upstream commit b74a072d8fb71d3c9ffba4a17d5943e63266fb38 ] A pair of descending VLAN and tunnel IDs can pass the tunnel range span check. The VLAN subtraction produces a negative int, which is converted to unsigned when compared with the u32 tunnel ID subtraction. It can therefore equal the wrapped tunnel ID delta. The range loop then performs no iterations. Since the batched notification handling added a post-loop error check, this leaves err uninitialized and makes the request's return value unpredictable. Reject descending VLAN ranges before comparing the spans. Valid ascending and single-entry ranges remain unchanged, while malformed descending ranges consistently return -EINVAL. This issue was found by a static analysis checker and confirmed by manual source review. Fixes: 94339443686b ("net: bridge: notify on vlan tunnel changes done via the old api") Signed-off-by: Ruoyu Wang Acked-by: Nikolay Aleksandrov Link: https://patch.msgid.link/20260814134053.1387275-1-ruoyuw560@gmail.com Signed-off-by: David S. Miller Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/bridge/br_netlink_tunnel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/bridge/br_netlink_tunnel.c b/net/bridge/br_netlink_tunnel.c index e4aab07752701..e7fe6b22cbf6f 100644 --- a/net/bridge/br_netlink_tunnel.c +++ b/net/bridge/br_netlink_tunnel.c @@ -299,7 +299,8 @@ int br_process_vlan_tunnel_info(const struct net_bridge *br, if (!(tinfo_last->flags & BRIDGE_VLAN_INFO_RANGE_BEGIN)) return -EINVAL; - if ((tinfo_curr->vid - tinfo_last->vid) != + if (tinfo_curr->vid < tinfo_last->vid || + (tinfo_curr->vid - tinfo_last->vid) != (tinfo_curr->tunid - tinfo_last->tunid)) return -EINVAL; t = tinfo_last->tunid; -- 2.53.0