CVE-2025-21867: bpf, test_run: Fix use-after-free issue in eth_skb_pkt_type()

Published Mar 27, 2025
·
Updated

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

bpf, testrun: Fix use-after-free issue in ethskbpkttype()

KMSAN reported a use-after-free issue in ethskbpkttype()[1]. The cause of the issue was that ethskbpkttype() accessed skb's data that didn't contain an Ethernet header. This occurs when bpfprogtestrunxdp() passes an invalid value as the userdata argument to bpftestinit().

Fix this by returning an error when userdata is less than ETHHLEN in bpftestinit(). Additionally, remove the check for "if (usersize > size)" as it is unnecessary.

[1] BUG: KMSAN: use-after-free in ethskbpkttype include/linux/etherdevice.h:627 [inline] BUG: KMSAN: use-after-free in ethtypetrans+0x4ee/0x980 net/ethernet/eth.c:165 ethskbpkttype include/linux/etherdevice.h:627 [inline] ethtypetrans+0x4ee/0x980 net/ethernet/eth.c:165 xdpbuildskbfromframe+0x5a8/0xa50 net/core/xdp.c:635 xdprecvframes net/bpf/testrun.c:272 [inline] xdptestrunbatch net/bpf/testrun.c:361 [inline] bpftestrunxdplive+0x2954/0x3330 net/bpf/testrun.c:390 bpfprogtestrunxdp+0x148e/0x1b10 net/bpf/testrun.c:1318 bpfprogtestrun+0x5b7/0xa30 kernel/bpf/syscall.c:4371 sysbpf+0x6a6/0xe20 kernel/bpf/syscall.c:5777 dosysbpf kernel/bpf/syscall.c:5866 [inline] sesysbpf kernel/bpf/syscall.c:5864 [inline] x64sysbpf+0xa4/0xf0 kernel/bpf/syscall.c:5864 x64syscall+0x2ea0/0x3d90 arch/x86/include/generated/asm/syscalls64.h:322 dosyscallx64 arch/x86/entry/common.c:52 [inline] dosyscall64+0xd9/0x1d0 arch/x86/entry/common.c:83 entrySYSCALL64afterhwframe+0x77/0x7f

Uninit was created at: freepagesprepare mm/pagealloc.c:1056 [inline] freeunrefpage+0x156/0x1320 mm/pagealloc.c:2657 freepages+0xa3/0x1b0 mm/pagealloc.c:4838 bpfringbuffree kernel/bpf/ringbuf.c:226 [inline] ringbufmapfree+0xff/0x1e0 kernel/bpf/ringbuf.c:235 bpfmapfree kernel/bpf/syscall.c:838 [inline] bpfmapfreedeferred+0x17c/0x310 kernel/bpf/syscall.c:862 processonework kernel/workqueue.c:3229 [inline] processscheduledworks+0xa2b/0x1b60 kernel/workqueue.c:3310 workerthread+0xedf/0x1550 kernel/workqueue.c:3391 kthread+0x535/0x6b0 kernel/kthread.c:389 retfromfork+0x6e/0x90 arch/x86/kernel/process.c:147 retfromforkasm+0x1a/0x30 arch/x86/entry/entry64.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 Software

133 affected componentsFixes available
Linux Kernel
Linux Linux kernel>=5.18<6.1.130
Linux Linux kernel>=6.2<6.6.80
Linux Linux kernel>=6.7<6.12.17
Linux Linux kernel>=6.13<6.13.5
Linux Linux kernel=6.14-rc1
Linux Linux kernel=6.14-rc2
Linux Linux kernel=6.14-rc3
debian/linux<6.1.133-1
6.1.133-1
debian/linux<6.12.17-1
6.12.17-1
debian/linux<6.12.17-1
6.12.17-1
linux/kernel>=5.18.0<6.1.130
6.1.130
linux/kernel>=6.2.0<6.6.80
6.6.80
linux/kernel>=6.7.0<6.12.17
6.12.17
linux/kernel>=6.13.0<6.13.5
6.13.5
debian/linux
6.1.133-16.12.17-1
debian/linux-6.1
6.1.137-1~deb11u1
ubuntu/linux-hwe-edge*
ubuntu/linux-aws-5.0*
ubuntu/linux-aws-5.3*
ubuntu/linux-azure*
ubuntu/linux-azure-5.3*
ubuntu/linux-azure-edge*
ubuntu/linux-gcp*
ubuntu/linux-gcp-5.3*
ubuntu/linux-gke-4.15*
ubuntu/linux-gke-5.4*
ubuntu/linux-gkeop-5.4*
ubuntu/linux-hwe*
ubuntu/linux-hwe-edge*
ubuntu/linux-oem*
ubuntu/linux-oracle-5.0*
ubuntu/linux-oracle-5.3*
ubuntu/linux-aws-5.11*
ubuntu/linux-aws-5.13*
ubuntu/linux-aws-5.8*
ubuntu/linux-azure-5.11*
ubuntu/linux-azure-5.13*
ubuntu/linux-azure-5.8*
ubuntu/linux-azure-fde*
ubuntu/linux-gcp-5.11*
ubuntu/linux-gcp-5.13*
ubuntu/linux-gcp-5.8*
ubuntu/linux-gke*
ubuntu/linux-gke-5.15*
ubuntu/linux-gkeop*
ubuntu/linux-gkeop-5.15*
ubuntu/linux-hwe-5.11*
ubuntu/linux-hwe-5.13*
ubuntu/linux-hwe-5.8*
ubuntu/linux-intel-5.13*
ubuntu/linux-oem-5.10*
ubuntu/linux-oem-5.13*
ubuntu/linux-oem-5.6*
ubuntu/linux-oracle-5.11*
ubuntu/linux-oracle-5.13*
ubuntu/linux-oracle-5.8*
ubuntu/linux-raspi2*
ubuntu/linux-riscv*
ubuntu/linux-riscv-5.11*
ubuntu/linux-riscv-5.8*
ubuntu/linux-allwinner-5.19*
ubuntu/linux-aws-5.19*
ubuntu/linux-aws-6.2*
ubuntu/linux-aws-6.5*
ubuntu/linux-aws-6.8<6.8.0-1035.37~22.04.1
6.8.0-1035.37~22.04.1
ubuntu/linux-azure-5.19*
ubuntu/linux-azure-6.2*
ubuntu/linux-azure-6.5*
ubuntu/linux-azure-6.8<6.8.0-1034.39~22.04.1
6.8.0-1034.39~22.04.1
ubuntu/linux-azure-fde-5.19*
ubuntu/linux-azure-fde-6.2*
ubuntu/linux-gcp-5.19*
ubuntu/linux-gcp-6.2*
ubuntu/linux-gcp-6.5*
ubuntu/linux-gcp-6.8<6.8.0-1036.38~22.04.1
6.8.0-1036.38~22.04.1
ubuntu/linux-hwe-5.19*
ubuntu/linux-hwe-6.2*
ubuntu/linux-hwe-6.5*
ubuntu/linux-hwe-6.8<6.8.0-78.78~22.04.1
6.8.0-78.78~22.04.1
ubuntu/linux-ibm-6.8<6.8.0-1033.33~22.04.1
6.8.0-1033.33~22.04.1
ubuntu/linux-intel-iot-realtime*
ubuntu/linux-lowlatency-hwe-5.19*
ubuntu/linux-lowlatency-hwe-6.2*
ubuntu/linux-lowlatency-hwe-6.5*
ubuntu/linux-lowlatency-hwe-6.8<6.8.0-78.78.1~22.04.1
6.8.0-78.78.1~22.04.1
ubuntu/linux-nvidia-6.2*
ubuntu/linux-nvidia-6.5*
ubuntu/linux-nvidia-6.8<6.8.0-1035.38~22.04.1
6.8.0-1035.38~22.04.1
ubuntu/linux-oem-5.17*
ubuntu/linux-oem-6.0*
ubuntu/linux-oem-6.1*
ubuntu/linux-oem-6.5*
ubuntu/linux-oracle-6.5*
ubuntu/linux-oracle-6.8<6.8.0-1032.33~22.04.1
6.8.0-1032.33~22.04.1
ubuntu/linux-realtime*
ubuntu/linux-riscv*
ubuntu/linux-riscv-5.19*
ubuntu/linux-riscv-6.5*
ubuntu/linux-riscv-6.8<6.8.0-78.78~22.04.1
6.8.0-78.78~22.04.1
ubuntu/linux-starfive-5.19*
ubuntu/linux-starfive-6.2*
ubuntu/linux-starfive-6.5*
ubuntu/linux-realtime-6.8<6.8.1-1030.31~22.04.1
6.8.1-1030.31~22.04.1
ubuntu/linux<6.8.0-78.78
6.8.0-78.78
ubuntu/linux-aws<6.8.0-1035.37
6.8.0-1035.37
ubuntu/linux-azure<6.8.0-1034.39
6.8.0-1034.39
ubuntu/linux-azure-6.11<6.11.0-1015.15~24.04.1
6.11.0-1015.15~24.04.1
ubuntu/linux-azure-nvidia<6.8.0-1022.23
6.8.0-1022.23
ubuntu/linux-gcp<6.8.0-1036.38
6.8.0-1036.38
ubuntu/linux-gcp-6.11<6.11.0-1015.15~24.04.1
6.11.0-1015.15~24.04.1
ubuntu/linux-gke<6.8.0-1032.36
6.8.0-1032.36
ubuntu/linux-gkeop<6.8.0-1019.21
6.8.0-1019.21
ubuntu/linux-hwe-6.11<6.11.0-26.26~24.04.1
6.11.0-26.26~24.04.1
ubuntu/linux-ibm<6.8.0-1033.33
6.8.0-1033.33
ubuntu/linux-intel*
ubuntu/linux-lowlatency<6.8.0-78.78.1
6.8.0-78.78.1
ubuntu/linux-lowlatency-hwe-6.11<6.11.0-1014.15~24.04.1
6.11.0-1014.15~24.04.1
ubuntu/linux-nvidia<6.8.0-1035.38
6.8.0-1035.38
ubuntu/linux-nvidia-6.11<6.11.0-1010.10
6.11.0-1010.10
ubuntu/linux-nvidia-lowlatency<6.8.0-1035.38.1
6.8.0-1035.38.1
ubuntu/linux-nvidia-tegra<6.8.0-1009.9
6.8.0-1009.9
ubuntu/linux-oem-6.11<6.11.0-1022.22
6.11.0-1022.22
ubuntu/linux-oem-6.8*
ubuntu/linux-oracle<6.8.0-1032.33
6.8.0-1032.33
ubuntu/linux-raspi<6.8.0-1035.39
6.8.0-1035.39
ubuntu/linux-raspi-realtime*
ubuntu/linux-realtime*
ubuntu/linux-riscv*
ubuntu/linux-xilinx<6.8.0-1017.18
6.8.0-1017.18
ubuntu/linux-raspi-realtime<6.8.0-2028.29
6.8.0-2028.29
ubuntu/linux-realtime<6.8.1-1030.31
6.8.1-1030.31
ubuntu/linux-fips<6.8.0-78.78+fips1
6.8.0-78.78+fips1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 6.1.133-1
  2. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 6.12.17-1
  3. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.1.130
  4. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.6.80
  5. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.12.17
  6. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.13.5
  7. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 6.1.133-1Fixed in 6.12.17-1
  8. Upgrade

    Upgrade debian/linux-6.1 to a version that resolves this vulnerability.

    Fixed in 6.1.137-1~deb11u1
  9. Upgrade

    Upgrade ubuntu/linux-aws-6.8 to a version that resolves this vulnerability.

    Fixed in 6.8.0-1035.37~22.04.1
  10. Upgrade

    Upgrade ubuntu/linux-azure-6.8 to a version that resolves this vulnerability.

    Fixed in 6.8.0-1034.39~22.04.1
  11. Upgrade

    Upgrade ubuntu/linux-gcp-6.8 to a version that resolves this vulnerability.

    Fixed in 6.8.0-1036.38~22.04.1
  12. Upgrade

    Upgrade ubuntu/linux-hwe-6.8 to a version that resolves this vulnerability.

    Fixed in 6.8.0-78.78~22.04.1
  13. Upgrade

    Upgrade ubuntu/linux-ibm-6.8 to a version that resolves this vulnerability.

    Fixed in 6.8.0-1033.33~22.04.1
  14. Upgrade

    Upgrade ubuntu/linux-lowlatency-hwe-6.8 to a version that resolves this vulnerability.

    Fixed in 6.8.0-78.78.1~22.04.1
  15. Upgrade

    Upgrade ubuntu/linux-nvidia-6.8 to a version that resolves this vulnerability.

    Fixed in 6.8.0-1035.38~22.04.1
  16. Upgrade

    Upgrade ubuntu/linux-oracle-6.8 to a version that resolves this vulnerability.

    Fixed in 6.8.0-1032.33~22.04.1
  17. Upgrade

    Upgrade ubuntu/linux-riscv-6.8 to a version that resolves this vulnerability.

    Fixed in 6.8.0-78.78~22.04.1
  18. Upgrade

    Upgrade ubuntu/linux-realtime-6.8 to a version that resolves this vulnerability.

    Fixed in 6.8.1-1030.31~22.04.1
  19. Upgrade

    Upgrade ubuntu/linux to a version that resolves this vulnerability.

    Fixed in 6.8.0-78.78
  20. Upgrade

    Upgrade ubuntu/linux-aws to a version that resolves this vulnerability.

    Fixed in 6.8.0-1035.37
  21. Upgrade

    Upgrade ubuntu/linux-azure to a version that resolves this vulnerability.

    Fixed in 6.8.0-1034.39
  22. Upgrade

    Upgrade ubuntu/linux-azure-6.11 to a version that resolves this vulnerability.

    Fixed in 6.11.0-1015.15~24.04.1
  23. Upgrade

    Upgrade ubuntu/linux-azure-nvidia to a version that resolves this vulnerability.

    Fixed in 6.8.0-1022.23
  24. Upgrade

    Upgrade ubuntu/linux-gcp to a version that resolves this vulnerability.

    Fixed in 6.8.0-1036.38
  25. Upgrade

    Upgrade ubuntu/linux-gcp-6.11 to a version that resolves this vulnerability.

    Fixed in 6.11.0-1015.15~24.04.1
  26. Upgrade

    Upgrade ubuntu/linux-gke to a version that resolves this vulnerability.

    Fixed in 6.8.0-1032.36
  27. Upgrade

    Upgrade ubuntu/linux-gkeop to a version that resolves this vulnerability.

    Fixed in 6.8.0-1019.21
  28. Upgrade

    Upgrade ubuntu/linux-hwe-6.11 to a version that resolves this vulnerability.

    Fixed in 6.11.0-26.26~24.04.1
  29. Upgrade

    Upgrade ubuntu/linux-ibm to a version that resolves this vulnerability.

    Fixed in 6.8.0-1033.33
  30. Upgrade

    Upgrade ubuntu/linux-lowlatency to a version that resolves this vulnerability.

    Fixed in 6.8.0-78.78.1
  31. Upgrade

    Upgrade ubuntu/linux-lowlatency-hwe-6.11 to a version that resolves this vulnerability.

    Fixed in 6.11.0-1014.15~24.04.1
  32. Upgrade

    Upgrade ubuntu/linux-nvidia to a version that resolves this vulnerability.

    Fixed in 6.8.0-1035.38
  33. Upgrade

    Upgrade ubuntu/linux-nvidia-6.11 to a version that resolves this vulnerability.

    Fixed in 6.11.0-1010.10
  34. Upgrade

    Upgrade ubuntu/linux-nvidia-lowlatency to a version that resolves this vulnerability.

    Fixed in 6.8.0-1035.38.1
  35. Upgrade

    Upgrade ubuntu/linux-nvidia-tegra to a version that resolves this vulnerability.

    Fixed in 6.8.0-1009.9
  36. Upgrade

    Upgrade ubuntu/linux-oem-6.11 to a version that resolves this vulnerability.

    Fixed in 6.11.0-1022.22
  37. Upgrade

    Upgrade ubuntu/linux-oracle to a version that resolves this vulnerability.

    Fixed in 6.8.0-1032.33
  38. Upgrade

    Upgrade ubuntu/linux-raspi to a version that resolves this vulnerability.

    Fixed in 6.8.0-1035.39
  39. Upgrade

    Upgrade ubuntu/linux-xilinx to a version that resolves this vulnerability.

    Fixed in 6.8.0-1017.18
  40. Upgrade

    Upgrade ubuntu/linux-raspi-realtime to a version that resolves this vulnerability.

    Fixed in 6.8.0-2028.29
  41. Upgrade

    Upgrade ubuntu/linux-realtime to a version that resolves this vulnerability.

    Fixed in 6.8.1-1030.31
  42. Upgrade

    Upgrade ubuntu/linux-fips to a version that resolves this vulnerability.

    Fixed in 6.8.0-78.78+fips1
  43. Compensating control

    In bpf_test_init(), return an error when user_data is less than ETH_HLEN before bpf_prog_test_run_xdp() processes the data.

  44. Compensating control

    Remove the unnecessary check for "if (user_size > size)".

Event History

Mar 27, 2025
CVE Published
via MITRE·01:38 PM
Data Sourced
via MITRE·01:38 PM
Description
Data Sourced
via OSV·01:38 PM
DescriptionSeverityAffected Software
Data Sourced
via Red Hat·02:01 PM
DescriptionSeverityAffected Software
Data Sourced
via NVD·02:15 PM
Description
Mar 28, 2025
Data Sourced
via NVD·06:15 PM
SeverityWeakness
Apr 1, 2025
Data Sourced
via NVD·03:44 PM
RemedyAffected Software
Nov 3, 2025
Updated
via NVD·08:17 PM
Affected Software
Jul 30, 2026
Data Sourced
via MITRE·05:46 AM
Severity
Oct 15, 2026
Updated
via NVD·02:17 AM
Severity

Parent advisories

This vulnerability appears in the following advisories.

Peer vulnerabilities

Found alongside the following vulnerabilities.

Frequently Asked Questions

1

What is the severity of CVE-2025-21867?

CVE-2025-21867 has been classified with a severity level that indicates potential risks associated with use-after-free vulnerabilities in the Linux kernel.

2

How do I fix CVE-2025-21867?

To address CVE-2025-21867, update your Linux kernel to the latest version where this vulnerability has been patched.

3

What is the impact of CVE-2025-21867?

CVE-2025-21867 can lead to undefined behavior in the kernel, potentially allowing attackers to exploit memory corruption vulnerabilities.

4

What systems are affected by CVE-2025-21867?

CVE-2025-21867 affects all versions of the Linux kernel prior to the patched versions released following the identification of the vulnerability.

5

Is CVE-2025-21867 being actively exploited?

As of the current information, there is no indication that CVE-2025-21867 is actively being exploited in the wild.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203