# CVE-2025-38470: net: vlan: fix VLAN 0 refcount imbalance of toggling filtering during runtime

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.31% (percentile 16, 2026-11-26)
- **Published:** 2025-07-28T11:21:32.002Z
- **Modified:** 2026-10-15T22:18:42.247Z

## Who should check

- Anyone running Linux \>= ad1afb00393915a51c21b1ae8704562bf036855f, \< ba48d3993af23753e1f1f01c8d592de9c7785f24; \>= ad1afb00393915a51c21b1ae8704562bf036855f, \< 35142b3816832889e50164d993018ea5810955ae; \>= ad1afb00393915a51c21b1ae8704562bf036855f, \< 047b61a24d7c866c502aeeea482892969a68f216; \>= ad1afb00393915a51c21b1ae8704562bf036855f, \< d43ef15bf4856c8c4c6c3572922331a5f06deb77; \>= ad1afb00393915a51c21b1ae8704562bf036855f, \< bb515c41306454937464da055609b5fb0a27821b; \>= ad1afb00393915a51c21b1ae8704562bf036855f, \< 8984bcbd1edf5bee5be06ad771d157333b790c33; \>= ad1afb00393915a51c21b1ae8704562bf036855f, \< 93715aa2d80e6c5cea1bb486321fc4585076928b; \>= ad1afb00393915a51c21b1ae8704562bf036855f, \< 579d4f9ca9a9a605184a9b162355f6ba131f678d
- Anyone running Linux 2.6.36

## Description

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

net: vlan: fix VLAN 0 refcount imbalance of toggling filtering during runtime

Assuming the "rx-vlan-filter" feature is enabled on a net device, the
8021q module will automatically add or remove VLAN 0 when the net device
is put administratively up or down, respectively. There are a couple of
problems with the above scheme.

The first problem is a memory leak that can happen if the "rx-vlan-filter"
feature is disabled while the device is running:

 \# ip link add bond1 up type bond mode 0
 \# ethtool -K bond1 rx-vlan-filter off
 \# ip link del dev bond1

When the device is put administratively down the "rx-vlan-filter"
feature is disabled, so the 8021q module will not remove VLAN 0 and the
memory will be leaked \[1\].

Another problem that can happen is that the kernel can automatically
delete VLAN 0 when the device is put administratively down despite not
adding it when the device was put administratively up since during that
time the "rx-vlan-filter" feature was disabled. null-ptr-unref or
bug\_on\[2\] will be triggered by unregister\_vlan\_dev() for refcount
imbalance if toggling filtering during runtime:

$ ip link add bond0 type bond mode 0
$ ip link add link bond0 name vlan0 type vlan id 0 protocol 802.1q
$ ethtool -K bond0 rx-vlan-filter off
$ ifconfig bond0 up
$ ethtool -K bond0 rx-vlan-filter on
$ ifconfig bond0 down
$ ip link del vlan0

Root cause is as below:
step1: add vlan0 for real\_dev, such as bond, team.
register\_vlan\_dev
    vlan\_vid\_add(real\_dev,htons(ETH\_P\_8021Q),0) //refcnt=1
step2: disable vlan filter feature and enable real\_dev
step3: change filter from 0 to 1
vlan\_device\_event
    vlan\_filter\_push\_vids
        ndo\_vlan\_rx\_add\_vid //No refcnt added to real\_dev vlan0
step4: real\_dev down
vlan\_device\_event
    vlan\_vid\_del(dev, htons(ETH\_P\_8021Q), 0); //refcnt=0
        vlan\_info\_rcu\_free //free vlan0
step5: delete vlan0
unregister\_vlan\_dev
    BUG\_ON(!vlan\_info); //vlan\_info is null

Fix both problems by noting in the VLAN info whether VLAN 0 was
automatically added upon NETDEV\_UP and based on that decide whether it
should be deleted upon NETDEV\_DOWN, regardless of the state of the
"rx-vlan-filter" feature.

\[1\]
unreferenced object 0xffff8880068e3100 (size 256):
  comm "ip", pid 384, jiffies 4296130254
  hex dump (first 32 bytes):
    00 20 30 0d 80 88 ff ff 00 00 00 00 00 00 00 00  . 0.............
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace (crc 81ce31fa):
    \_\_kmalloc\_cache\_noprof+0x2b5/0x340
    vlan\_vid\_add+0x434/0x940
    vlan\_device\_event.cold+0x75/0xa8
    notifier\_call\_chain+0xca/0x150
    \_\_dev\_notify\_flags+0xe3/0x250
    rtnl\_configure\_link+0x193/0x260
    rtnl\_newlink\_create+0x383/0x8e0
    \_\_rtnl\_newlink+0x22c/0xa40
    rtnl\_newlink+0x627/0xb00
    rtnetlink\_rcv\_msg+0x6fb/0xb70
    netlink\_rcv\_skb+0x11f/0x350
    netlink\_unicast+0x426/0x710
    netlink\_sendmsg+0x75a/0xc20
    \_\_sock\_sendmsg+0xc1/0x150
    \_\_\_\_sys\_sendmsg+0x5aa/0x7b0
    \_\_\_sys\_sendmsg+0xfc/0x180

\[2\]
kernel BUG at net/8021q/vlan.c:99!
Oops: invalid opcode: 0000 \[\#1\] SMP KASAN PTI
CPU: 0 UID: 0 PID: 382 Comm: ip Not tainted 6.16.0-rc3 \#61 PREEMPT(voluntary)
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),
BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
RIP: 0010:unregister\_vlan\_dev (net/8021q/vlan.c:99 (discriminator 1))
RSP: 0018:ffff88810badf310 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff88810da84000 RCX: ffffffffb47ceb9a
RDX: dffffc0000000000 RSI: 0000000000000008 RDI: ffff88810e8b43c8
RBP: 0000000000000000 R08: 0000000000000000 R09: fffffbfff6cefe80
R10: ffffffffb677f407 R11: ffff88810badf3c0 R12: ffff88810e8b4000
R13: 0000000000000000 R14: ffff88810642a5c0 R15: 000000000000017e
FS:  00007f1ff68c20c0(0000) GS:ffff888163a24000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f1ff5dad240 CR3: 0000000107e56000 CR4: 00000000000006f0
Call Trace:
 \<TASK
---truncated---

## Affected and fixed versions

- Linux: \>= ad1afb00393915a51c21b1ae8704562bf036855f, \< ba48d3993af23753e1f1f01c8d592de9c7785f24; \>= ad1afb00393915a51c21b1ae8704562bf036855f, \< 35142b3816832889e50164d993018ea5810955ae; \>= ad1afb00393915a51c21b1ae8704562bf036855f, \< 047b61a24d7c866c502aeeea482892969a68f216; \>= ad1afb00393915a51c21b1ae8704562bf036855f, \< d43ef15bf4856c8c4c6c3572922331a5f06deb77; \>= ad1afb00393915a51c21b1ae8704562bf036855f, \< bb515c41306454937464da055609b5fb0a27821b; \>= ad1afb00393915a51c21b1ae8704562bf036855f, \< 8984bcbd1edf5bee5be06ad771d157333b790c33; \>= ad1afb00393915a51c21b1ae8704562bf036855f, \< 93715aa2d80e6c5cea1bb486321fc4585076928b; \>= ad1afb00393915a51c21b1ae8704562bf036855f, \< 579d4f9ca9a9a605184a9b162355f6ba131f678d (cvelist)
- Linux: 2.6.36 (cvelist)

## Mitigation

- Upgrade Linux to 579d4f9ca9a9a605184a9b162355f6ba131f678d or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-38470. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-38470.md
Affected: Linux >= ad1afb00393915a51c21b1ae8704562bf036855f, < ba48d3993af23753e1f1f01c8d592de9c7785f24; >= ad1afb00393915a51c21b1ae8704562bf036855f, < 35142b3816832889e50164d993018ea5810955ae; >= ad1afb00393915a51c21b1ae8704562bf036855f, < 047b61a24d7c866c502aeeea482892969a68f216; >= ad1afb00393915a51c21b1a…
Fixed in: Linux 35142b3816832889e50164d993018ea5810955ae, Linux 047b61a24d7c866c502aeeea482892969a68f216, Linux 8984bcbd1edf5bee5be06ad771d157333b790c33, Linux 93715aa2d80e6c5cea1bb486321fc4585076928b, Linux 579d4f9ca9a9a605184a9b162355f6ba131f678d

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-38470 being exploited?

There is no confirmed exploitation: CVE-2025-38470 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.31% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2025-38470?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2025-38470?

Linux \>= ad1afb00393915a51c21b1ae8704562bf036855f, \< ba48d3993af23753e1f1f01c8d592de9c7785f24; \>= ad1afb00393915a51c21b1ae8704562bf036855f, \< 35142b3816832889e50164d993018ea5810955ae; \>= ad1afb00393915a51c21b1ae8704562bf036855f, \< 047b61a24d7c866c502aeeea482892969a68f216; \>= ad1afb00393915a51c21b1ae8704562bf036855f, \< d43ef15bf4856c8c4c6c3572922331a5f06deb77; \>= ad1afb00393915a51c21b1ae8704562bf036855f, \< bb515c41306454937464da055609b5fb0a27821b; \>= ad1afb00393915a51c21b1ae8704562bf036855f, \< 8984bcbd1edf5bee5be06ad771d157333b790c33; \>= ad1afb00393915a51c21b1ae8704562bf036855f, \< 93715aa2d80e6c5cea1bb486321fc4585076928b; \>= ad1afb00393915a51c21b1ae8704562bf036855f, \< 579d4f9ca9a9a605184a9b162355f6ba131f678d; Linux 2.6.36.

### Is there a fix for CVE-2025-38470?

Yes. Fixed in Linux 35142b3816832889e50164d993018ea5810955ae, Linux 047b61a24d7c866c502aeeea482892969a68f216, Linux 8984bcbd1edf5bee5be06ad771d157333b790c33, Linux 93715aa2d80e6c5cea1bb486321fc4585076928b, Linux 579d4f9ca9a9a605184a9b162355f6ba131f678d. Upgrade Linux to 579d4f9ca9a9a605184a9b162355f6ba131f678d or later.

### How do I check if I'm affected by CVE-2025-38470?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/ba48d3993af23753e1f1f01c8d592de9c7785f24>
- patch: <https://git.kernel.org/stable/c/35142b3816832889e50164d993018ea5810955ae>
- patch: <https://git.kernel.org/stable/c/047b61a24d7c866c502aeeea482892969a68f216>
- patch: <https://git.kernel.org/stable/c/d43ef15bf4856c8c4c6c3572922331a5f06deb77>
- patch: <https://git.kernel.org/stable/c/bb515c41306454937464da055609b5fb0a27821b>
- patch: <https://git.kernel.org/stable/c/8984bcbd1edf5bee5be06ad771d157333b790c33>
- patch: <https://git.kernel.org/stable/c/93715aa2d80e6c5cea1bb486321fc4585076928b>
- patch: <https://git.kernel.org/stable/c/579d4f9ca9a9a605184a9b162355f6ba131f678d>
- other: <https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html>
- other: <https://lists.debian.org/debian-lts-announce/2025/10/msg00007.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-082556.html>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-38470>

HTML: <https://flawdb.com/CVE-2025-38470> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-38470>
