# CVE-2025-21867: bpf, test\_run: Fix use-after-free issue in eth\_skb\_pkt\_type()

> 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.30% (percentile 15, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2025-03-27T13:38:20.673Z
- **Modified:** 2026-11-10T13:17:38.043Z

## Who should check

- Anyone running Linux \>= be3d72a2896cb24090f268dce4aa8a304d40bc23, \< f615fccfc689cb48977d275ac2e391297b52392b; \>= be3d72a2896cb24090f268dce4aa8a304d40bc23, \< d56d8a23d95100b65f40438639dd82db2af81c11; \>= be3d72a2896cb24090f268dce4aa8a304d40bc23, \< 972bafed67ca73ad9a56448384281eb5fd5c0ba3; \>= be3d72a2896cb24090f268dce4aa8a304d40bc23, \< 1a9e1284e87d59b1303b69d1808d310821d6e5f7; \>= be3d72a2896cb24090f268dce4aa8a304d40bc23, \< 6b3d638ca897e099fa99bd6d02189d3176f80a47
- Anyone running Linux 5.18

## Description

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

bpf, test\_run: Fix use-after-free issue in eth\_skb\_pkt\_type()

KMSAN reported a use-after-free issue in eth\_skb\_pkt\_type()\[1\]. The
cause of the issue was that eth\_skb\_pkt\_type() accessed skb's data
that didn't contain an Ethernet header. This occurs when
bpf\_prog\_test\_run\_xdp() passes an invalid value as the user\_data
argument to bpf\_test\_init().

Fix this by returning an error when user\_data is less than ETH\_HLEN in
bpf\_test\_init(). Additionally, remove the check for "if (user\_size \>
size)" as it is unnecessary.

\[1\]
BUG: KMSAN: use-after-free in eth\_skb\_pkt\_type include/linux/etherdevice.h:627 \[inline\]
BUG: KMSAN: use-after-free in eth\_type\_trans+0x4ee/0x980 net/ethernet/eth.c:165
 eth\_skb\_pkt\_type include/linux/etherdevice.h:627 \[inline\]
 eth\_type\_trans+0x4ee/0x980 net/ethernet/eth.c:165
 \_\_xdp\_build\_skb\_from\_frame+0x5a8/0xa50 net/core/xdp.c:635
 xdp\_recv\_frames net/bpf/test\_run.c:272 \[inline\]
 xdp\_test\_run\_batch net/bpf/test\_run.c:361 \[inline\]
 bpf\_test\_run\_xdp\_live+0x2954/0x3330 net/bpf/test\_run.c:390
 bpf\_prog\_test\_run\_xdp+0x148e/0x1b10 net/bpf/test\_run.c:1318
 bpf\_prog\_test\_run+0x5b7/0xa30 kernel/bpf/syscall.c:4371
 \_\_sys\_bpf+0x6a6/0xe20 kernel/bpf/syscall.c:5777
 \_\_do\_sys\_bpf kernel/bpf/syscall.c:5866 \[inline\]
 \_\_se\_sys\_bpf kernel/bpf/syscall.c:5864 \[inline\]
 \_\_x64\_sys\_bpf+0xa4/0xf0 kernel/bpf/syscall.c:5864
 x64\_sys\_call+0x2ea0/0x3d90 arch/x86/include/generated/asm/syscalls\_64.h:322
 do\_syscall\_x64 arch/x86/entry/common.c:52 \[inline\]
 do\_syscall\_64+0xd9/0x1d0 arch/x86/entry/common.c:83
 entry\_SYSCALL\_64\_after\_hwframe+0x77/0x7f

Uninit was created at:
 free\_pages\_prepare mm/page\_alloc.c:1056 \[inline\]
 free\_unref\_page+0x156/0x1320 mm/page\_alloc.c:2657
 \_\_free\_pages+0xa3/0x1b0 mm/page\_alloc.c:4838
 bpf\_ringbuf\_free kernel/bpf/ringbuf.c:226 \[inline\]
 ringbuf\_map\_free+0xff/0x1e0 kernel/bpf/ringbuf.c:235
 bpf\_map\_free kernel/bpf/syscall.c:838 \[inline\]
 bpf\_map\_free\_deferred+0x17c/0x310 kernel/bpf/syscall.c:862
 process\_one\_work kernel/workqueue.c:3229 \[inline\]
 process\_scheduled\_works+0xa2b/0x1b60 kernel/workqueue.c:3310
 worker\_thread+0xedf/0x1550 kernel/workqueue.c:3391
 kthread+0x535/0x6b0 kernel/kthread.c:389
 ret\_from\_fork+0x6e/0x90 arch/x86/kernel/process.c:147
 ret\_from\_fork\_asm+0x1a/0x30 arch/x86/entry/entry\_64.S:244

CPU: 1 UID: 0 PID: 17276 Comm: syz.1.16450 Not tainted 6.12.0-05490-g9bb88c659673 \#8
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-3.fc41 04/01/2014

## Affected and fixed versions

- Linux: \>= be3d72a2896cb24090f268dce4aa8a304d40bc23, \< f615fccfc689cb48977d275ac2e391297b52392b; \>= be3d72a2896cb24090f268dce4aa8a304d40bc23, \< d56d8a23d95100b65f40438639dd82db2af81c11; \>= be3d72a2896cb24090f268dce4aa8a304d40bc23, \< 972bafed67ca73ad9a56448384281eb5fd5c0ba3; \>= be3d72a2896cb24090f268dce4aa8a304d40bc23, \< 1a9e1284e87d59b1303b69d1808d310821d6e5f7; \>= be3d72a2896cb24090f268dce4aa8a304d40bc23, \< 6b3d638ca897e099fa99bd6d02189d3176f80a47 (cvelist)
- Linux: 5.18 (cvelist)

## Mitigation

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

Details: https://flawdb.com/CVE-2025-21867.md
Affected: Linux >= be3d72a2896cb24090f268dce4aa8a304d40bc23, < f615fccfc689cb48977d275ac2e391297b52392b; >= be3d72a2896cb24090f268dce4aa8a304d40bc23, < d56d8a23d95100b65f40438639dd82db2af81c11; >= be3d72a2896cb24090f268dce4aa8a304d40bc23, < 972bafed67ca73ad9a56448384281eb5fd5c0ba3; >= be3d72a2896cb24090f268d…
Fixed in: Linux 972bafed67ca73ad9a56448384281eb5fd5c0ba3, Linux 1a9e1284e87d59b1303b69d1808d310821d6e5f7, Linux 6b3d638ca897e099fa99bd6d02189d3176f80a47

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

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

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

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

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

Linux \>= be3d72a2896cb24090f268dce4aa8a304d40bc23, \< f615fccfc689cb48977d275ac2e391297b52392b; \>= be3d72a2896cb24090f268dce4aa8a304d40bc23, \< d56d8a23d95100b65f40438639dd82db2af81c11; \>= be3d72a2896cb24090f268dce4aa8a304d40bc23, \< 972bafed67ca73ad9a56448384281eb5fd5c0ba3; \>= be3d72a2896cb24090f268dce4aa8a304d40bc23, \< 1a9e1284e87d59b1303b69d1808d310821d6e5f7; \>= be3d72a2896cb24090f268dce4aa8a304d40bc23, \< 6b3d638ca897e099fa99bd6d02189d3176f80a47; Linux 5.18.

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

Yes. Fixed in Linux 972bafed67ca73ad9a56448384281eb5fd5c0ba3, Linux 1a9e1284e87d59b1303b69d1808d310821d6e5f7, Linux 6b3d638ca897e099fa99bd6d02189d3176f80a47. Upgrade Linux to 6b3d638ca897e099fa99bd6d02189d3176f80a47 or later.

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

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/f615fccfc689cb48977d275ac2e391297b52392b>
- patch: <https://git.kernel.org/stable/c/d56d8a23d95100b65f40438639dd82db2af81c11>
- patch: <https://git.kernel.org/stable/c/972bafed67ca73ad9a56448384281eb5fd5c0ba3>
- patch: <https://git.kernel.org/stable/c/1a9e1284e87d59b1303b69d1808d310821d6e5f7>
- patch: <https://git.kernel.org/stable/c/6b3d638ca897e099fa99bd6d02189d3176f80a47>
- other: <https://lists.debian.org/debian-lts-announce/2025/05/msg00045.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-019113.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-457936.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-21867>

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