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 4248626C386 for ; Fri, 9 May 2025 06:44:05 +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=1746773045; cv=none; b=WyQdqhoYROE8G7mixwaU/dXOhtyXnUsbtLqxKw4YFDBLs5YZOI75P1SG87U6joCkWX9VaV3TosCBl4kiJ9B4qtJNW867UKzFp20TqmSEJEV9rUXPdq5uzySWgOcj8rMTFVW5u/DWV8RtTRPkmGBY7aDAdejl++AE80nQGVy7BAQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746773045; c=relaxed/simple; bh=LoxkbH1ch8SbWMcTF43s0PZ1TA4yZ40bjifOyI2bE6o=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=FNWvjU9130kmZCPELAPwCdba17zxsX9g2U1zRjjeA8ecG/5G+6kNnrer+UeUmWjat4eFFeLNhxs0Wl7so7vVFPzBjcDLgQNQi4VnFcoeVa1AE3W4rRzw/rvIGocmXOeKRdo1mFG12YupY+YIcYAQ30rD9PqBIxRXL3g5FUMkOPs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=2Edh3ajK; 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="2Edh3ajK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 560D4C4CEE9; Fri, 9 May 2025 06:44:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1746773045; bh=LoxkbH1ch8SbWMcTF43s0PZ1TA4yZ40bjifOyI2bE6o=; h=From:To:Cc:Subject:Date:Reply-to:From; b=2Edh3ajKnrWEF28cIFTERpeBEfPDGVGUbjBTLLCWMx5UxeibpUzYTL65BiUXRC9av dxMqn8iAQpzMHQ8panFMvmYVa6dONuAxABAPmyr98J2iX2WRyBu1it89waZic1w9U4 WmgTWrjH1B39T9YNwTRDSdzqmN1+pj6P4WDSSmQo= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-37864: net: dsa: clean up FDB, MDB, VLAN entries on unbind Date: Fri, 9 May 2025 08:43:58 +0200 Message-ID: <2025050957-CVE-2025-37864-ffd5@gregkh> X-Mailer: git-send-email 2.49.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=4500; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=uiL+Rcu2bGgsEpst4zz+dMTzFSeyUa0CH9dOKtYz3vk=; b=owGbwMvMwCRo6H6F97bub03G02pJDBmyS3S97t39atGZLzZp3xOPBX23PY6b/N3Mtu5xp0vUE gHxv++aO2JZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAi7I8Z5tmsmHh5Dwtr75c4 WR0tf80ti3vZDzIsWK1hpPS2tf4HU3XF/WfMP0+9324aBAA= 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: dsa: clean up FDB, MDB, VLAN entries on unbind As explained in many places such as commit b117e1e8a86d ("net: dsa: delete dsa_legacy_fdb_add and dsa_legacy_fdb_del"), DSA is written given the assumption that higher layers have balanced additions/deletions. As such, it only makes sense to be extremely vocal when those assumptions are violated and the driver unbinds with entries still present. But Ido Schimmel points out a very simple situation where that is wrong: https://lore.kernel.org/netdev/ZDazSM5UsPPjQuKr@shredder/ (also briefly discussed by me in the aforementioned commit). Basically, while the bridge bypass operations are not something that DSA explicitly documents, and for the majority of DSA drivers this API simply causes them to go to promiscuous mode, that isn't the case for all drivers. Some have the necessary requirements for bridge bypass operations to do something useful - see dsa_switch_supports_uc_filtering(). Although in tools/testing/selftests/net/forwarding/local_termination.sh, we made an effort to popularize better mechanisms to manage address filters on DSA interfaces from user space - namely macvlan for unicast, and setsockopt(IP_ADD_MEMBERSHIP) - through mtools - for multicast, the fact is that 'bridge fdb add ... self static local' also exists as kernel UAPI, and might be useful to someone, even if only for a quick hack. It seems counter-productive to block that path by implementing shim .ndo_fdb_add and .ndo_fdb_del operations which just return -EOPNOTSUPP in order to prevent the ndo_dflt_fdb_add() and ndo_dflt_fdb_del() from running, although we could do that. Accepting that cleanup is necessary seems to be the only option. Especially since we appear to be coming back at this from a different angle as well. Russell King is noticing that the WARN_ON() triggers even for VLANs: https://lore.kernel.org/netdev/Z_li8Bj8bD4-BYKQ@shell.armlinux.org.uk/ What happens in the bug report above is that dsa_port_do_vlan_del() fails, then the VLAN entry lingers on, and then we warn on unbind and leak it. This is not a straight revert of the blamed commit, but we now add an informational print to the kernel log (to still have a way to see that bugs exist), and some extra comments gathered from past years' experience, to justify the logic. The Linux kernel CVE team has assigned CVE-2025-37864 to this issue. Affected and fixed versions =========================== Issue introduced in 5.18 with commit 0832cd9f1f023226527e95002d537123061ddac4 and fixed in 6.6.88 with commit 86c6613a69bca815f1865ed8cedfd4b9142621ab Issue introduced in 5.18 with commit 0832cd9f1f023226527e95002d537123061ddac4 and fixed in 6.12.25 with commit 8fcc1e6f808912977caf17366c625b95dc29ba4f Issue introduced in 5.18 with commit 0832cd9f1f023226527e95002d537123061ddac4 and fixed in 6.14.4 with commit 99c50c98803425378e08a7394dc885506dc85f06 Issue introduced in 5.18 with commit 0832cd9f1f023226527e95002d537123061ddac4 and fixed in 6.15-rc3 with commit 7afb5fb42d4950f33af2732b8147c552659f79b7 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-37864 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/dsa/dsa.c 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/86c6613a69bca815f1865ed8cedfd4b9142621ab https://git.kernel.org/stable/c/8fcc1e6f808912977caf17366c625b95dc29ba4f https://git.kernel.org/stable/c/99c50c98803425378e08a7394dc885506dc85f06 https://git.kernel.org/stable/c/7afb5fb42d4950f33af2732b8147c552659f79b7