CVE-2025-40319
NoneCVSS
—
EPSS
0.1%
Published
Dec 8, 2025
CISA due date
—
Cloudanix analysis
A bug in the Linux kernel could let someone with local access crash the system or gain higher privileges by misusing certain tracing programs.
- Exploitation
- Local Privilege
- Attacker needs
- Low Privilege
- Complexity
- Moderate
- Impact
- Full Compromise
- Component
- OS kernel
- Class
- Race Condition
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Medium
What it actually does
Race condition in BPF ring buffer handling allows irq_work queued by bpf_ringbuf_commit() to execute after the ring buffer is freed, resulting in use-after-free access to kernel memory.
Why it matters to the business
Local attackers on affected Linux systems can trigger kernel crashes, denial of service, or potential privilege escalation; high ecosystem prevalence increases exposure for servers, containers, and embedded devices until kernels are updated.
How an attack unfolds
An attacker with local access loads a BPF program attached to sched_switch that calls bpf_ringbuf_commit() to queue irq_work, then frees the ring buffer before the work executes, causing the irq_work thread to dereference freed memory.
How to fix it
Update the Linux kernel to a version containing commit 47626748a2a00068dbbd5836d19076637b4e235b or later; rebuild and reboot with the patched kernel; disable untrusted BPF program loading via sysctl where feasible until patched.
How to confirm the fix worked
Verify kernel source or package version includes commit 47626748a2a00068dbbd5836d19076637b4e235b; confirm irq_work_sync is called before ring buffer free in bpf_ringbuf_free; test with reproducer workloads that previously triggered the race.
Typical attack path
- Obtain local unprivileged access on a vulnerable Linux system
- Load a malicious or crafted BPF program that triggers bpf_ringbuf_commit() on sched_switch
- Race the ring buffer free operation against pending irq_work execution
- Trigger use-after-free to crash the kernel or attempt memory corruption for escalation
How to detect it
Search kernel logs for oops, warnings, or use-after-free reports referencing bpf_ringbuf, ring buffer, or irq_work; inspect audit logs for unexpected BPF program loads or attachments around crash times.
What your security team should do
- Prioritize kernel updates on all systems allowing unprivileged BPF loading within the next patch cycle
- Restrict BPF privileges using CAP_BPF and unprivileged_bpf_disabled sysctl until patches are deployed
- Monitor for kernel oops or crashes involving bpf_ringbuf or irq_work as potential exploitation signs
- Review and limit BPF program attachment points on production hosts
The record
In the Linux kernel, the following vulnerability has been resolved: bpf: Sync pending IRQ work before freeing ring buffer Fix a race where irq_work can be queued in bpf_ringbuf_commit() but the ring buffer is freed before the work executes. In the syzbot reproducer, a BPF program attached to sched_switch triggers bpf_ringbuf_commit(), queuing an irq_work. If the ring buffer is freed before this work executes, the irq_work thread may accesses freed memory. Calling `irq_work_sync(&rb->work)` ensures that all pending irq_work complete before freeing the buffer.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Linux | Kernel | 5.8.0 | 5.10.247 |
| Mageia:9 | kernel | 0 | 6.6.120-1.mga9 |
| Mageia:9 | kernel-linus | 0 | 6.6.120-1.mga9 |
| Mageia:9 | kmod-virtualbox | 0 | 7.1.14-14.mga9 |
| Mageia:9 | kmod-xtables-addons | 0 | 3.24-88.mga9 |
| openSUSE:Leap 16.0 | dtb-aarch64 | 0 | 6.12.0-160000.9.1 |
| openSUSE:Leap 16.0 | kernel-64kb | 0 | 6.12.0-160000.9.1 |
| openSUSE:Leap 16.0 | kernel-azure | 0 | 6.12.0-160000.9.1 |
| openSUSE:Leap 16.0 | kernel-default | 0 | 6.12.0-160000.9.1 |
| openSUSE:Leap 16.0 | kernel-default-base | 0 | 6.12.0-160000.9.1.160000.2.6 |
| openSUSE:Leap 16.0 | kernel-docs | 0 | 6.12.0-160000.9.1 |
| openSUSE:Leap 16.0 | kernel-kvmsmall | 0 | 6.12.0-160000.9.1 |
| openSUSE:Leap 16.0 | kernel-obs-build | 0 | 6.12.0-160000.9.1 |
| openSUSE:Leap 16.0 | kernel-obs-qa | 0 | 6.12.0-160000.9.1 |
| openSUSE:Leap 16.0 | kernel-rt | 0 | 6.12.0-160000.9.1 |
| openSUSE:Leap 16.0 | kernel-source | 0 | 6.12.0-160000.9.1 |
| openSUSE:Leap 16.0 | kernel-syms | 0 | 6.12.0-160000.9.1 |
| openSUSE:Leap 16.0 | kernel-zfcpdump | 0 | 6.12.0-160000.9.1 |
Related vulnerabilities
- CVE-2026-23226 In the Linux kernel, the following vulnerability has been resolved: ksmbd: add chann_lock… Also affects Kernel
- CVE-2026-23225 In the Linux kernel, the following vulnerability has been resolved: sched/mmcid: Don't… Also affects Kernel
- CVE-2026-23230 In the Linux kernel, the following vulnerability has been resolved: smb: client: split… Also affects Kernel
- CVE-2026-23224 In the Linux kernel, the following vulnerability has been resolved: erofs: fix UAF issue… Also affects Kernel
- CVE-2026-23227 In the Linux kernel, the following vulnerability has been resolved: drm/exynos: vidi: use… Also affects Kernel
- CVE-2026-23223 In the Linux kernel, the following vulnerability has been resolved: xfs: fix UAF in… Also affects Kernel
- CVE-2026-23228 In the Linux kernel, the following vulnerability has been resolved: smb: server: fix leak… Also affects Kernel
- CVE-2026-23229 In the Linux kernel, the following vulnerability has been resolved: crypto: virtio - Add… Also affects Kernel