# CVE-2025-40297: net: bridge: fix use-after-free due to MST port state bypass

> 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.24% (percentile 9, 2026-11-26)
- **Published:** 2025-12-08T00:46:21.112Z
- **Modified:** 2026-10-15T22:19:07.277Z

## Who should check

- Anyone running Linux \>= ec7328b59176227216c461601c6bd0e922232a9b, \< e19085b2a86addccff33ab8536fc67ebd9d52198; \>= ec7328b59176227216c461601c6bd0e922232a9b, \< 3b60ce334c1ce8b3fad7e02dcd5ed9f6646477c8; \>= ec7328b59176227216c461601c6bd0e922232a9b, \< bf3843183bc3158e5821b46f330c438ae9bd6ddb; \>= ec7328b59176227216c461601c6bd0e922232a9b, \< 991fbe1680cd41a5f97c92cd3a3496315df36e4b; \>= ec7328b59176227216c461601c6bd0e922232a9b, \< 8dca36978aa80bab9d4da130c211db75c9e00048
- Anyone running Linux 5.18

## Description

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

net: bridge: fix use-after-free due to MST port state bypass

syzbot reported\[1\] a use-after-free when deleting an expired fdb. It is
due to a race condition between learning still happening and a port being
deleted, after all its fdbs have been flushed. The port's state has been
toggled to disabled so no learning should happen at that time, but if we
have MST enabled, it will bypass the port's state, that together with VLAN
filtering disabled can lead to fdb learning at a time when it shouldn't
happen while the port is being deleted. VLAN filtering must be disabled
because we flush the port VLANs when it's being deleted which will stop
learning. This fix adds a check for the port's vlan group which is
initialized to NULL when the port is getting deleted, that avoids the port
state bypass. When MST is enabled there would be a minimal new overhead
in the fast-path because the port's vlan group pointer is cache-hot.

\[1\] https://syzkaller.appspot.com/bug?extid=dd280197f0f7ab3917be

## Affected and fixed versions

- Linux: \>= ec7328b59176227216c461601c6bd0e922232a9b, \< e19085b2a86addccff33ab8536fc67ebd9d52198; \>= ec7328b59176227216c461601c6bd0e922232a9b, \< 3b60ce334c1ce8b3fad7e02dcd5ed9f6646477c8; \>= ec7328b59176227216c461601c6bd0e922232a9b, \< bf3843183bc3158e5821b46f330c438ae9bd6ddb; \>= ec7328b59176227216c461601c6bd0e922232a9b, \< 991fbe1680cd41a5f97c92cd3a3496315df36e4b; \>= ec7328b59176227216c461601c6bd0e922232a9b, \< 8dca36978aa80bab9d4da130c211db75c9e00048 (cvelist)
- Linux: 5.18 (cvelist)

## Mitigation

- Upgrade Linux to 8dca36978aa80bab9d4da130c211db75c9e00048 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-40297. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-40297.md
Affected: Linux >= ec7328b59176227216c461601c6bd0e922232a9b, < e19085b2a86addccff33ab8536fc67ebd9d52198; >= ec7328b59176227216c461601c6bd0e922232a9b, < 3b60ce334c1ce8b3fad7e02dcd5ed9f6646477c8; >= ec7328b59176227216c461601c6bd0e922232a9b, < bf3843183bc3158e5821b46f330c438ae9bd6ddb; >= ec7328b59176227216c4616…
Fixed in: Linux 3b60ce334c1ce8b3fad7e02dcd5ed9f6646477c8, Linux 991fbe1680cd41a5f97c92cd3a3496315df36e4b, Linux 8dca36978aa80bab9d4da130c211db75c9e00048

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-40297 being exploited?

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

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

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

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

Linux \>= ec7328b59176227216c461601c6bd0e922232a9b, \< e19085b2a86addccff33ab8536fc67ebd9d52198; \>= ec7328b59176227216c461601c6bd0e922232a9b, \< 3b60ce334c1ce8b3fad7e02dcd5ed9f6646477c8; \>= ec7328b59176227216c461601c6bd0e922232a9b, \< bf3843183bc3158e5821b46f330c438ae9bd6ddb; \>= ec7328b59176227216c461601c6bd0e922232a9b, \< 991fbe1680cd41a5f97c92cd3a3496315df36e4b; \>= ec7328b59176227216c461601c6bd0e922232a9b, \< 8dca36978aa80bab9d4da130c211db75c9e00048; Linux 5.18.

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

Yes. Fixed in Linux 3b60ce334c1ce8b3fad7e02dcd5ed9f6646477c8, Linux 991fbe1680cd41a5f97c92cd3a3496315df36e4b, Linux 8dca36978aa80bab9d4da130c211db75c9e00048. Upgrade Linux to 8dca36978aa80bab9d4da130c211db75c9e00048 or later.

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

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

- other: <https://git.kernel.org/stable/c/e19085b2a86addccff33ab8536fc67ebd9d52198>
- other: <https://git.kernel.org/stable/c/3b60ce334c1ce8b3fad7e02dcd5ed9f6646477c8>
- other: <https://git.kernel.org/stable/c/bf3843183bc3158e5821b46f330c438ae9bd6ddb>
- other: <https://git.kernel.org/stable/c/991fbe1680cd41a5f97c92cd3a3496315df36e4b>
- other: <https://git.kernel.org/stable/c/8dca36978aa80bab9d4da130c211db75c9e00048>

## 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-40297>

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