# CVE-2025-38248: bridge: mcast: Fix use-after-free during router port configuration

> 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.28% (percentile 13, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2025-07-09T10:42:29.133Z
- **Modified:** 2026-10-30T13:18:02.580Z

## Who should check

- Anyone running Linux \>= 2796d846d74a18cc6563e96eff8bf28c5e06f912, \< 5df2d582f6e8a81e7ab066464845b38b2fb04094; \>= 2796d846d74a18cc6563e96eff8bf28c5e06f912, \< 7bb080340bb5ffc928f47c563a9ca1528ce54911; \>= 2796d846d74a18cc6563e96eff8bf28c5e06f912, \< 4d3c2a1d4c7c33103f1ddfdbc5cfe1ea4f6d0dcd; \>= 2796d846d74a18cc6563e96eff8bf28c5e06f912, \< bdced577da71b118b6ed4242ebd47f81bf54d406; \>= 2796d846d74a18cc6563e96eff8bf28c5e06f912, \< f05a4f9e959e0fc098046044c650acf897ea52d2; \>= 2796d846d74a18cc6563e96eff8bf28c5e06f912, \< 7544f3f5b0b58c396f374d060898b5939da31709
- Anyone running Linux 5.15

## Description

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

bridge: mcast: Fix use-after-free during router port configuration

The bridge maintains a global list of ports behind which a multicast
router resides. The list is consulted during forwarding to ensure
multicast packets are forwarded to these ports even if the ports are not
member in the matching MDB entry.

When per-VLAN multicast snooping is enabled, the per-port multicast
context is disabled on each port and the port is removed from the global
router port list:

 \# ip link add name br1 up type bridge vlan\_filtering 1 mcast\_snooping 1
 \# ip link add name dummy1 up master br1 type dummy
 \# ip link set dev dummy1 type bridge\_slave mcast\_router 2
 $ bridge -d mdb show \| grep router
 router ports on br1: dummy1
 \# ip link set dev br1 type bridge mcast\_vlan\_snooping 1
 $ bridge -d mdb show \| grep router

However, the port can be re-added to the global list even when per-VLAN
multicast snooping is enabled:

 \# ip link set dev dummy1 type bridge\_slave mcast\_router 0
 \# ip link set dev dummy1 type bridge\_slave mcast\_router 2
 $ bridge -d mdb show \| grep router
 router ports on br1: dummy1

Since commit 4b30ae9adb04 ("net: bridge: mcast: re-implement
br\_multicast\_{enable, disable}\_port functions"), when per-VLAN multicast
snooping is enabled, multicast disablement on a port will disable the
per-{port, VLAN} multicast contexts and not the per-port one. As a
result, a port will remain in the global router port list even after it
is deleted. This will lead to a use-after-free \[1\] when the list is
traversed (when adding a new port to the list, for example):

 \# ip link del dev dummy1
 \# ip link add name dummy2 up master br1 type dummy
 \# ip link set dev dummy2 type bridge\_slave mcast\_router 2

Similarly, stale entries can also be found in the per-VLAN router port
list. When per-VLAN multicast snooping is disabled, the per-{port, VLAN}
contexts are disabled on each port and the port is removed from the
per-VLAN router port list:

 \# ip link add name br1 up type bridge vlan\_filtering 1 mcast\_snooping 1 mcast\_vlan\_snooping 1
 \# ip link add name dummy1 up master br1 type dummy
 \# bridge vlan add vid 2 dev dummy1
 \# bridge vlan global set vid 2 dev br1 mcast\_snooping 1
 \# bridge vlan set vid 2 dev dummy1 mcast\_router 2
 $ bridge vlan global show dev br1 vid 2 \| grep router
       router ports: dummy1
 \# ip link set dev br1 type bridge mcast\_vlan\_snooping 0
 $ bridge vlan global show dev br1 vid 2 \| grep router

However, the port can be re-added to the per-VLAN list even when
per-VLAN multicast snooping is disabled:

 \# bridge vlan set vid 2 dev dummy1 mcast\_router 0
 \# bridge vlan set vid 2 dev dummy1 mcast\_router 2
 $ bridge vlan global show dev br1 vid 2 \| grep router
       router ports: dummy1

When the VLAN is deleted from the port, the per-{port, VLAN} multicast
context will not be disabled since multicast snooping is not enabled
on the VLAN. As a result, the port will remain in the per-VLAN router
port list even after it is no longer member in the VLAN. This will lead
to a use-after-free \[2\] when the list is traversed (when adding a new
port to the list, for example):

 \# ip link add name dummy2 up master br1 type dummy
 \# bridge vlan add vid 2 dev dummy2
 \# bridge vlan del vid 2 dev dummy1
 \# bridge vlan set vid 2 dev dummy2 mcast\_router 2

Fix these issues by removing the port from the relevant (global or
per-VLAN) router port list in br\_multicast\_port\_ctx\_deinit(). The
function is invoked during port deletion with the per-port multicast
context and during VLAN deletion with the per-{port, VLAN} multicast
context.

Note that deleting the multicast router timer is not enough as it only
takes care of the temporary multicast router states (1 or 3) and not the
permanent one (2).

\[1\]
BUG: KASAN: slab-out-of-bounds in br\_multicast\_add\_router.part.0+0x3f1/0x560
Write of size 8 at addr ffff888004a67328 by task ip/384
\[...\]
Call Trace:
 \<TASK\>
 dump\_stack
---truncated---

## Affected and fixed versions

- Linux: \>= 2796d846d74a18cc6563e96eff8bf28c5e06f912, \< 5df2d582f6e8a81e7ab066464845b38b2fb04094; \>= 2796d846d74a18cc6563e96eff8bf28c5e06f912, \< 7bb080340bb5ffc928f47c563a9ca1528ce54911; \>= 2796d846d74a18cc6563e96eff8bf28c5e06f912, \< 4d3c2a1d4c7c33103f1ddfdbc5cfe1ea4f6d0dcd; \>= 2796d846d74a18cc6563e96eff8bf28c5e06f912, \< bdced577da71b118b6ed4242ebd47f81bf54d406; \>= 2796d846d74a18cc6563e96eff8bf28c5e06f912, \< f05a4f9e959e0fc098046044c650acf897ea52d2; \>= 2796d846d74a18cc6563e96eff8bf28c5e06f912, \< 7544f3f5b0b58c396f374d060898b5939da31709 (cvelist)
- Linux: 5.15 (cvelist)

## Mitigation

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

Details: https://flawdb.com/CVE-2025-38248.md
Affected: Linux >= 2796d846d74a18cc6563e96eff8bf28c5e06f912, < 5df2d582f6e8a81e7ab066464845b38b2fb04094; >= 2796d846d74a18cc6563e96eff8bf28c5e06f912, < 7bb080340bb5ffc928f47c563a9ca1528ce54911; >= 2796d846d74a18cc6563e96eff8bf28c5e06f912, < 4d3c2a1d4c7c33103f1ddfdbc5cfe1ea4f6d0dcd; >= 2796d846d74a18cc6563e96…
Fixed in: Linux 5df2d582f6e8a81e7ab066464845b38b2fb04094, Linux 7bb080340bb5ffc928f47c563a9ca1528ce54911, Linux 4d3c2a1d4c7c33103f1ddfdbc5cfe1ea4f6d0dcd, Linux 7544f3f5b0b58c396f374d060898b5939da31709

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

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

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

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

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

Linux \>= 2796d846d74a18cc6563e96eff8bf28c5e06f912, \< 5df2d582f6e8a81e7ab066464845b38b2fb04094; \>= 2796d846d74a18cc6563e96eff8bf28c5e06f912, \< 7bb080340bb5ffc928f47c563a9ca1528ce54911; \>= 2796d846d74a18cc6563e96eff8bf28c5e06f912, \< 4d3c2a1d4c7c33103f1ddfdbc5cfe1ea4f6d0dcd; \>= 2796d846d74a18cc6563e96eff8bf28c5e06f912, \< bdced577da71b118b6ed4242ebd47f81bf54d406; \>= 2796d846d74a18cc6563e96eff8bf28c5e06f912, \< f05a4f9e959e0fc098046044c650acf897ea52d2; \>= 2796d846d74a18cc6563e96eff8bf28c5e06f912, \< 7544f3f5b0b58c396f374d060898b5939da31709; Linux 5.15.

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

Yes. Fixed in Linux 5df2d582f6e8a81e7ab066464845b38b2fb04094, Linux 7bb080340bb5ffc928f47c563a9ca1528ce54911, Linux 4d3c2a1d4c7c33103f1ddfdbc5cfe1ea4f6d0dcd, Linux 7544f3f5b0b58c396f374d060898b5939da31709. Upgrade Linux to 7544f3f5b0b58c396f374d060898b5939da31709 or later.

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

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/4d3c2a1d4c7c33103f1ddfdbc5cfe1ea4f6d0dcd>
- patch: <https://git.kernel.org/stable/c/bdced577da71b118b6ed4242ebd47f81bf54d406>
- patch: <https://git.kernel.org/stable/c/f05a4f9e959e0fc098046044c650acf897ea52d2>
- patch: <https://git.kernel.org/stable/c/7544f3f5b0b58c396f374d060898b5939da31709>
- other: <https://git.kernel.org/stable/c/5df2d582f6e8a81e7ab066464845b38b2fb04094>
- other: <https://git.kernel.org/stable/c/7bb080340bb5ffc928f47c563a9ca1528ce54911>

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

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