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 0287E1A9FAA for ; Mon, 8 Dec 2025 00:48:46 +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=1765154927; cv=none; b=s8T0wzukGTjmkktpyhe+SQkxTW4Jc/NPl9+fEACiAnsRoI1mBuObF+v53PhxUfmZke3BeEudsFbE+ZvNnLtvnmmCvRZy7tTZXgNGyIbxdqMRjD9AOCAWEJwRLh5KS4lK6lCu5A0GIEHoJg7p3qYQPjW23ec7rvfLsLYnKwF3eOI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765154927; c=relaxed/simple; bh=edKZhAz5QbeokNps0ciJoldzb02gVGlJ6IfF6lBZfcA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=UXzUQIPfLsN3bdyCHLJCfvBHScnbGTwZBCoT3n/EUkjRivaAFC4Rh6L86V8z7ST/F/scQnteg7pNDxH07bK+gVWlfSdnitPgUVyyJ+q91SpdMbMNHpndJJ/bnTIjcwVFSfelB/JU+OlutCnvI0syDT+tDMofFiSOkfsPuElozTQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Lw6A0zWW; 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="Lw6A0zWW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37CDBC4CEFB; Mon, 8 Dec 2025 00:48:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1765154926; bh=edKZhAz5QbeokNps0ciJoldzb02gVGlJ6IfF6lBZfcA=; h=From:To:Cc:Subject:Date:Reply-To:From; b=Lw6A0zWWh1223CluYLpCTy15sHmDWJCEPCDZ1T0L28dW+fOnAEAFEwSPSqUkGDyC6 FVVz6Agvx6eSl+apLaayDRrsQoUjlF7PQ5eQy1/prdXKJE1OOGiq2z+BGrFvZ/J9NX X26CPhtUhoJbI0f6yPQ5N5LbmkxlWv42QwPc8MQE= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-40297: net: bridge: fix use-after-free due to MST port state bypass Date: Mon, 8 Dec 2025 09:47:22 +0900 Message-ID: <2025120819-CVE-2025-40297-8d83@gregkh> X-Mailer: git-send-email 2.52.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3448; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=k6hVtSvwlr1ouEMUtamLjyWWRWYEJ1s90B4KdMj3elY=; b=owGbwMvMwCRo6H6F97bub03G02pJDJlmCuJH7VwFc/8fO7PEfMeLSdf2zDQ3+jk/799ORvFvT jWNC3MWdMSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEVsYxzM/5czX65gROe2PL 455ak5a2JU749o5hwZFvttODrrDG9HE9EKuZUZn79pPQXAA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: net: bridge: fix use-after-free due to MST port state bypass syzbot reported[1] a use-after-free when deleting an expired fdb. It is due to a race condition between learning still happening and a port being deleted, after all its fdbs have been flushed. The port's state has been toggled to disabled so no learning should happen at that time, but if we have MST enabled, it will bypass the port's state, that together with VLAN filtering disabled can lead to fdb learning at a time when it shouldn't happen while the port is being deleted. VLAN filtering must be disabled because we flush the port VLANs when it's being deleted which will stop learning. This fix adds a check for the port's vlan group which is initialized to NULL when the port is getting deleted, that avoids the port state bypass. When MST is enabled there would be a minimal new overhead in the fast-path because the port's vlan group pointer is cache-hot. [1] https://syzkaller.appspot.com/bug?extid=dd280197f0f7ab3917be The Linux kernel CVE team has assigned CVE-2025-40297 to this issue. Affected and fixed versions =========================== Issue introduced in 5.18 with commit ec7328b59176227216c461601c6bd0e922232a9b and fixed in 6.1.159 with commit e19085b2a86addccff33ab8536fc67ebd9d52198 Issue introduced in 5.18 with commit ec7328b59176227216c461601c6bd0e922232a9b and fixed in 6.6.117 with commit 3b60ce334c1ce8b3fad7e02dcd5ed9f6646477c8 Issue introduced in 5.18 with commit ec7328b59176227216c461601c6bd0e922232a9b and fixed in 6.12.58 with commit bf3843183bc3158e5821b46f330c438ae9bd6ddb Issue introduced in 5.18 with commit ec7328b59176227216c461601c6bd0e922232a9b and fixed in 6.17.8 with commit 991fbe1680cd41a5f97c92cd3a3496315df36e4b Issue introduced in 5.18 with commit ec7328b59176227216c461601c6bd0e922232a9b and fixed in 6.18 with commit 8dca36978aa80bab9d4da130c211db75c9e00048 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2025-40297 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: net/bridge/br_forward.c net/bridge/br_input.c net/bridge/br_private.h Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/e19085b2a86addccff33ab8536fc67ebd9d52198 https://git.kernel.org/stable/c/3b60ce334c1ce8b3fad7e02dcd5ed9f6646477c8 https://git.kernel.org/stable/c/bf3843183bc3158e5821b46f330c438ae9bd6ddb https://git.kernel.org/stable/c/991fbe1680cd41a5f97c92cd3a3496315df36e4b https://git.kernel.org/stable/c/8dca36978aa80bab9d4da130c211db75c9e00048