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

> A use-after-free in the Linux kernel bridge multicast module allows attackers to cause denial of service or execute code when per-VLAN multicast snooping is enabled.

- **Severity:** High 7.8 (`CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 9 Jul 2025
- **Updated:** 5 Aug 2026
- **Also known as:** AZL-64841, AZL-70492, BELL-CVE-2025-38248, DEBIAN-CVE-2025-38248, GHSA-2838-84rj-32xc, RHSA-2026:5692, ROOT-OS-DEBIAN-12-CVE-2025-38248, ROOT-OS-DEBIAN-13-CVE-2025-38248, ROOT-OS-UBUNTU-2204-CVE-2025-38248, ROOT-OS-UBUNTU-2404-CVE-2025-38248, UBUNTU-CVE-2025-38248

## What is CVE-2025-38248?

CVE-2025-38248 is a high-severity use after free vulnerability in Linux kernel, published on 9 Jul 2025. It can only be exploited from the same machine or local network, with no action from the victim.

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

Weakness: CWE-416 (Use After Free)

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

It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `bpftool-debuginfo` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:7.3.0-427.116.1.el9_4 |
| `kernel-64k-debug-debuginfo` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:5.14.0-427.116.1.el9_4 |
| `kernel-64k-debug-devel` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:5.14.0-427.116.1.el9_4 |
| `kernel-64k-debug-devel-matched` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:5.14.0-427.116.1.el9_4 |
| `kernel-64k-debuginfo` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:5.14.0-427.116.1.el9_4 |
| `kernel-64k-devel` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:5.14.0-427.116.1.el9_4 |
| `kernel-64k-devel-matched` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:5.14.0-427.116.1.el9_4 |
| `kernel-debug-debuginfo` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:5.14.0-427.116.1.el9_4 |
| `kernel-debug-devel` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:5.14.0-427.116.1.el9_4 |
| `kernel-debug-devel-matched` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:5.14.0-427.116.1.el9_4 |
| `kernel-debuginfo` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:5.14.0-427.116.1.el9_4 |
| `kernel-debuginfo-common-aarch64` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:5.14.0-427.116.1.el9_4 |
| `kernel-debuginfo-common-ppc64le` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:5.14.0-427.116.1.el9_4 |
| `kernel-debuginfo-common-s390x` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:5.14.0-427.116.1.el9_4 |
| `kernel-debuginfo-common-x86_64` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:5.14.0-427.116.1.el9_4 |
| `kernel-devel` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:5.14.0-427.116.1.el9_4 |
| `kernel-devel-matched` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:5.14.0-427.116.1.el9_4 |
| `kernel-doc` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:5.14.0-427.116.1.el9_4 |
| `kernel-rt-debug-debuginfo` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:5.14.0-427.116.1.el9_4 |
| `kernel-rt-debuginfo` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:5.14.0-427.116.1.el9_4 |
| `kernel-tools-debuginfo` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:5.14.0-427.116.1.el9_4 |
| `kernel-zfcpdump-debuginfo` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:5.14.0-427.116.1.el9_4 |
| `kernel-zfcpdump-devel` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:5.14.0-427.116.1.el9_4 |
| `kernel-zfcpdump-devel-matched` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:5.14.0-427.116.1.el9_4 |
| `libperf-debuginfo` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:5.14.0-427.116.1.el9_4 |
| `perf` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:5.14.0-427.116.1.el9_4 |
| `perf-debuginfo` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:5.14.0-427.116.1.el9_4 |
| `python3-perf-debuginfo` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:5.14.0-427.116.1.el9_4 |
| `rtla` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:5.14.0-427.116.1.el9_4 |
| `rv` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:5.14.0-427.116.1.el9_4 |
| `bpftool` | Red Hat:rhel_eus:9.4::baseos | All versions | 0:7.3.0-427.116.1.el9_4 |
| `bpftool-debuginfo` | Red Hat:rhel_eus:9.4::baseos | All versions | 0:7.3.0-427.116.1.el9_4 |
| `kernel` | Red Hat:rhel_eus:9.4::baseos | All versions | 0:5.14.0-427.116.1.el9_4 |
| `kernel-64k` | Red Hat:rhel_eus:9.4::baseos | All versions | 0:5.14.0-427.116.1.el9_4 |
| `kernel-64k-core` | Red Hat:rhel_eus:9.4::baseos | All versions | 0:5.14.0-427.116.1.el9_4 |
| `kernel-64k-debug` | Red Hat:rhel_eus:9.4::baseos | All versions | 0:5.14.0-427.116.1.el9_4 |
| `kernel-64k-debug-core` | Red Hat:rhel_eus:9.4::baseos | All versions | 0:5.14.0-427.116.1.el9_4 |
| `kernel-64k-debug-debuginfo` | Red Hat:rhel_eus:9.4::baseos | All versions | 0:5.14.0-427.116.1.el9_4 |
| `kernel-64k-debug-modules` | Red Hat:rhel_eus:9.4::baseos | All versions | 0:5.14.0-427.116.1.el9_4 |
| `kernel-64k-debug-modules-core` | Red Hat:rhel_eus:9.4::baseos | All versions | 0:5.14.0-427.116.1.el9_4 |

Products: Linux kernel.

## How do I fix CVE-2025-38248?

Apply the vendor's patch.

## Is CVE-2025-38248 being exploited?

There is no known exploitation of CVE-2025-38248 in the wild and no public exploit code.

Public exploit code:

- The first detail for CVE-2025-38248 (github_poc): https://github.com/guard-wait/CVE-2025-38248_EXP

## Other vulnerabilities in Linux kernel

- [CVE-2026-53266](https://insights.sbomify.com/CVE-2026-53266/): Linux Kernel Out-of-Bounds Write (high 8.8, exploited in the wild)
- [CVE-2013-6282](https://insights.sbomify.com/CVE-2013-6282/): Linux Kernel Improper Input Validation (high 8.8, exploited in the wild)
- [CVE-2022-0185](https://insights.sbomify.com/CVE-2022-0185/): Linux Kernel Heap-Based Buffer Overflow (high 8.4, exploited in the wild)
- [CVE-2013-2094](https://insights.sbomify.com/CVE-2013-2094/): Linux Kernel Privilege Escalation (high 8.4, exploited in the wild)
- [CVE-2026-53362](https://insights.sbomify.com/CVE-2026-53362/): Linux Kernel Unspecified (high 7.8, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-38248 and fix it if it is affected.

What it is: CVE-2025-38248 is a high-severity use after free vulnerability in Linux kernel, published on 9 Jul 2025. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2025-38248 in the wild and no public exploit code.

Affected product: Linux kernel. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-38248/ (Markdown: https://insights.sbomify.com/CVE-2025-38248/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-38248
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-38248
- OSV: https://osv.dev/vulnerability/CVE-2025-38248

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-38248/
Summaries are generated and may contain mistakes; the official description above is the record.
