CVE-2025-37865

net: dsa: mv88e6xxx: fix -ENOENT when deleting VLANs and MST is unsupported

No CVSS score yet EPSS 0.29%

Published 9 May 2025 Updated 11 May 2026 CNA: Linux

Check your servers for CVE-2025-37865

The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2025-37865 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.

Check my servers

Description

In the Linux kernel, the following vulnerability has been resolved:

net: dsa: mv88e6xxx: fix -ENOENT when deleting VLANs and MST is unsupported

Russell King reports that on the ZII dev rev B, deleting a bridge VLAN from a user port fails with -ENOENT: https://lore.kernel.org/netdev/Z_lQXNP0s5-IiJzd@shell.armlinux.org.uk/

This comes from mv88e6xxx_port_vlan_leave() -> mv88e6xxx_mst_put(), which tries to find an MST entry in &chip->msts associated with the SID, but fails and returns -ENOENT as such.

But we know that this chip does not support MST at all, so that is not surprising. The question is why does the guard in mv88e6xxx_mst_put() not exit early:

if (!sid) return 0;

And the answer seems to be simple: the sid comes from vlan.sid which supposedly was previously populated by mv88e6xxx_vtu_get(). But some chip->info->ops->vtu_getnext() implementations do not populate vlan.sid, for example see mv88e6185_g1_vtu_getnext(). In that case, later in mv88e6xxx_port_vlan_leave() we are using a garbage sid which is just residual stack memory.

Testing for sid == 0 covers all cases of a non-bridge VLAN or a bridge VLAN mapped to the default MSTI. For some chips, SID 0 is valid and installed by mv88e6xxx_stu_setup(). A chip which does not support the STU would implicitly only support mapping all VLANs to the default MSTI, so although SID 0 is not valid, it would be sufficient, if we were to zero-initialize the vlan structure, to fix the bug, due to the coincidence that a test for vlan.sid == 0 already exists and leads to the same (correct) behavior.

Another option which would be sufficient would be to add a test for mv88e6xxx_has_stu() inside mv88e6xxx_mst_put(), symmetric to the one which already exists in mv88e6xxx_mst_get(). But that placement means the caller will have to dereference vlan.sid, which means it will access uninitialized memory, which is not nice even if it ignores it later.

So we end up making both modifications, in order to not rely just on the sid == 0 coincidence, but also to avoid having uninitialized structure fields which might get temporarily accessed.

Exploitation

EPSS 0.29%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 22.8% of all scored CVEs. Scores of 1 Dec 2026.

Affected products

As the CNA lists them.

ProductVersions
Linux
affected from acaf4d2e36b3466334af4d3ee6ac254c3316165c, before 35cde75c08a1fa1a5ac0467afe2709caceeef002
affected from acaf4d2e36b3466334af4d3ee6ac254c3316165c, before afae9087301471970254a9180e5a26d3d8e8af09
affected from acaf4d2e36b3466334af4d3ee6ac254c3316165c, before 9ee6d3a368ed34f2457863da3085c676e9e37a3d
affected from acaf4d2e36b3466334af4d3ee6ac254c3316165c, before 9da4acbd60664271d34a627f7f63cd5bad8eba74
affected from acaf4d2e36b3466334af4d3ee6ac254c3316165c, before ea08dfc35f83cfc73493c52f63ae4f2e29edfe8d
Other versions: unaffected
Linux
affected 5.18
unaffected before 5.18
unaffected from 6.1.135 up to and including 6.1.*
unaffected from 6.6.88 up to and including 6.6.*
unaffected from 6.12.25 up to and including 6.12.*
unaffected from 6.14.4 up to and including 6.14.*
unaffected 6.15 and later
Other versions: affected

Is my server affected?

This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:

uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2025-37865 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2025-37865

With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:

trivy rootfs --scanners vuln / | grep CVE-2025-37865
trivy image --scanners vuln IMAGE | grep CVE-2025-37865

Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.

References

Other references

Source: the record CVE-2025-37865 of the CVE List (CVE Program), CVE Terms of Use; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.