UBUNTU-CVE-2025-37865
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/[email protected]/ 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.
02 / AFFECTED SOFTWARE
Affected packages
11 explicit affected versions
50 explicit affected versions
6 explicit affected versions
12 explicit affected versions
19 explicit affected versions
6 explicit affected versions
24 explicit affected versions
10 explicit affected versions
28 explicit affected versions
26 explicit affected versions
7 explicit affected versions
32 explicit affected versions
13 explicit affected versions
35 explicit affected versions
35 explicit affected versions
18 explicit affected versions
37 explicit affected versions
13 explicit affected versions
4 explicit affected versions
23 explicit affected versions
43 explicit affected versions
1 explicit affected versions
21 explicit affected versions
9 explicit affected versions
16 explicit affected versions
10 explicit affected versions
39 explicit affected versions
8 explicit affected versions
7 explicit affected versions
12 explicit affected versions
7 explicit affected versions
12 explicit affected versions
14 explicit affected versions
10 explicit affected versions
1 explicit affected versions
7 explicit affected versions
9 explicit affected versions
12 explicit affected versions
12 explicit affected versions
32 explicit affected versions
23 explicit affected versions
25 explicit affected versions
10 explicit affected versions
37 explicit affected versions
10 explicit affected versions
13 explicit affected versions
31 explicit affected versions
10 explicit affected versions
26 explicit affected versions
3 explicit affected versions
13 explicit affected versions
29 explicit affected versions
13 explicit affected versions
32 explicit affected versions
32 explicit affected versions
33 explicit affected versions
23 explicit affected versions
10 explicit affected versions
11 explicit affected versions
10 explicit affected versions
11 explicit affected versions
12 explicit affected versions
7 explicit affected versions
12 explicit affected versions
10 explicit affected versions
26 explicit affected versions
31 explicit affected versions
26 explicit affected versions
38 explicit affected versions
13 explicit affected versions
37 explicit affected versions
16 explicit affected versions
41 explicit affected versions
3 explicit affected versions
7 explicit affected versions
51 explicit affected versions
18 explicit affected versions
33 explicit affected versions
12 explicit affected versions
27 explicit affected versions
34 explicit affected versions
8 explicit affected versions
5 explicit affected versions
3 explicit affected versions
8 explicit affected versions
10 explicit affected versions
7 explicit affected versions
37 explicit affected versions
13 explicit affected versions
13 explicit affected versions
7 explicit affected versions
8 explicit affected versions
10 explicit affected versions
12 explicit affected versions
44 explicit affected versions
16 explicit affected versions
3 explicit affected versions
13 explicit affected versions
26 explicit affected versions
45 explicit affected versions
37 explicit affected versions
42 explicit affected versions
14 explicit affected versions
38 explicit affected versions
9 explicit affected versions
11 explicit affected versions
30 explicit affected versions
13 explicit affected versions
8 explicit affected versions
7 explicit affected versions
4 explicit affected versions
1 explicit affected versions
13 explicit affected versions
43 explicit affected versions
10 explicit affected versions
8 explicit affected versions
36 explicit affected versions
14 explicit affected versions
4 explicit affected versions
78 explicit affected versions
11 explicit affected versions
1 explicit affected versions
10 explicit affected versions
30 explicit affected versions
03 / CONNECTIONS
Connected vulnerabilities
04 / EVIDENCE
Source records
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/[email protected]/ 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.
05 / REFERENCES
Further evidence
- https://git.kernel.org/linus/ea08dfc35f83cfc73493c52f63ae4f2e29edfe8d
- https://git.kernel.org/stable/c/35cde75c08a1fa1a5ac0467afe2709caceeef002
- https://git.kernel.org/stable/c/9da4acbd60664271d34a627f7f63cd5bad8eba74
- https://git.kernel.org/stable/c/9ee6d3a368ed34f2457863da3085c676e9e37a3d
- https://git.kernel.org/stable/c/afae9087301471970254a9180e5a26d3d8e8af09
- https://git.kernel.org/stable/c/ea08dfc35f83cfc73493c52f63ae4f2e29edfe8d
- https://ubuntu.com/security/CVE-2025-37865
- https://ubuntu.com/security/notices/USN-7594-1
- https://ubuntu.com/security/notices/USN-7594-2
- https://ubuntu.com/security/notices/USN-7594-3
- https://ubuntu.com/security/notices/USN-8028-1
- https://ubuntu.com/security/notices/USN-8028-2
- https://ubuntu.com/security/notices/USN-8028-3
- https://ubuntu.com/security/notices/USN-8028-4
- https://ubuntu.com/security/notices/USN-8028-5
- https://ubuntu.com/security/notices/USN-8028-6
- https://ubuntu.com/security/notices/USN-8028-7
- https://ubuntu.com/security/notices/USN-8028-8
- https://ubuntu.com/security/notices/USN-8031-1
- https://ubuntu.com/security/notices/USN-8031-2
- https://ubuntu.com/security/notices/USN-8031-3
- https://ubuntu.com/security/notices/USN-8052-1
- https://ubuntu.com/security/notices/USN-8052-2
- https://ubuntu.com/security/notices/USN-8074-1
- https://ubuntu.com/security/notices/USN-8074-2
- https://ubuntu.com/security/notices/USN-8126-1
- https://www.cve.org/CVERecord?id=CVE-2025-37865