Kernel code execution via truncated BPF return pointer
Published Oct 28, 2025 · Updated Oct 28, 2025
Memory corruption in the LoongArch BPF JIT in Linux 6.17 through 6.17.2 allows local users to execute code in the kernel. The struct_ops trampoline truncates an eight-byte pointer return to 32 bits before sign-extending it, causing kernel code to dereference an attacker-steered address. Access to a delegated CAP_BPF token, or ordinary traffic on a host already running an affected BPF qdisc, is required; exploitation can disclose or modify kernel memory, execute kernel code, or crash the system.
Summary
What happened
Memory corruption in the LoongArch BPF JIT in Linux 6.17 through 6.17.2 allows local users to execute code in the kernel. The struct_ops trampoline truncates an eight-byte pointer return to 32 bits before sign-extending it, causing kernel code to dereference an attacker-steered address. Access to a delegated CAP_BPF token, or ordinary traffic on a host already running an affected BPF qdisc, is required; exploitation can disclose or modify kernel memory, execute kernel code, or crash the system.
The record
- CVE
- CVE-2025-40041
- Published
- Oct 28, 2025
- Updated
- Oct 28, 2025
- Vendor
- The Linux Kernel Organization
- Product
- Linux
- Classifications
- T1068
- Attack vector
- local
- Privileges
- authenticated
Timeline
How it unfolded
- Oct 28, 2025CVE publishedPublication date reported by the CVE source.
- Oct 28, 2025Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
Compare these published version ranges with your installed build and any vendor patches.
- Affected versionversion=6.17
- Affected versionversion=6abf17d690d83d25f6d00a1a2cd3553c7d20c2d8 <8b51b11b3d81c1ed48a52f87da9256d737b723a0
- Affected versionversion=6abf17d690d83d25f6d00a1a2cd3553c7d20c2d8 <9f3169bb3c2967166b4f4433cf152a84f3eb95d0
What conditions does exploitation require?
What is affected?
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Weakness, pattern, technique
Public exploit references
- ns_bpf_qdisc kernel selftest reproducerproof of concept · demonstrated
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Book a demo to see how Hinoki identifies affected software and validates exploitability in your environment.
Book a demo