| From bippy-1.2.0 Mon Sep 17 00:00:00 2001 |
| From: Greg Kroah-Hartman <gregkh@kernel.org> |
| To: <linux-cve-announce@vger.kernel.org> |
| Reply-to: <cve@kernel.org>, <linux-kernel@vger.kernel.org> |
| Subject: CVE-2025-37864: net: dsa: clean up FDB, MDB, VLAN entries on unbind |
| |
| 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 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 |