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… (CVE-2025-40319)
A race condition vulnerability in the Linux kernel's BPF subsystem was resolved by ensuring synchronization of pending IRQ work before freeing the ring buffer. The issue could cause the irq_work thread to access freed memory if the ring buffer is freed before the queued irq_work executes. This vulnerability was triggered by a BPF program attached to sched_switch that calls bpf_ringbuf_commit(), queuing irq_work. The fix involves calling irq_work_sync() to wait for all pending irq_work to complete before freeing the buffer.
AI Analysis
Technical Summary
CVE-2025-40319 addresses a race condition in the Linux kernel's BPF ring buffer implementation. Specifically, irq_work can be queued in bpf_ringbuf_commit(), but if the ring buffer is freed before the irq_work executes, the irq_work thread may access freed memory, leading to potential memory corruption or system instability. The vulnerability was demonstrated by a syzbot reproducer involving a BPF program attached to sched_switch. The fix synchronizes pending irq_work with irq_work_sync(&rb->work) before freeing the ring buffer, preventing use-after-free conditions.
Potential Impact
Successful exploitation could lead to use-after-free conditions in kernel memory, potentially causing system crashes, memory corruption, or privilege escalation. The CVSS vector indicates local attack vector with low complexity and low privileges required, no user interaction, and high impact on confidentiality, integrity, and availability.
Mitigation Recommendations
A fix has been implemented in the Linux kernel to synchronize pending irq_work before freeing the ring buffer, eliminating the race condition. Users should apply the official kernel updates that include this fix. Patch status is not explicitly confirmed here; check the Linux kernel vendor advisory or source repository for the exact fixed versions and apply updates accordingly.
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… (CVE-2025-40319)
Description
A race condition vulnerability in the Linux kernel's BPF subsystem was resolved by ensuring synchronization of pending IRQ work before freeing the ring buffer. The issue could cause the irq_work thread to access freed memory if the ring buffer is freed before the queued irq_work executes. This vulnerability was triggered by a BPF program attached to sched_switch that calls bpf_ringbuf_commit(), queuing irq_work. The fix involves calling irq_work_sync() to wait for all pending irq_work to complete before freeing the buffer.
CVSS v3.1
Score 7.8high
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2025-40319 addresses a race condition in the Linux kernel's BPF ring buffer implementation. Specifically, irq_work can be queued in bpf_ringbuf_commit(), but if the ring buffer is freed before the irq_work executes, the irq_work thread may access freed memory, leading to potential memory corruption or system instability. The vulnerability was demonstrated by a syzbot reproducer involving a BPF program attached to sched_switch. The fix synchronizes pending irq_work with irq_work_sync(&rb->work) before freeing the ring buffer, preventing use-after-free conditions.
Potential Impact
Successful exploitation could lead to use-after-free conditions in kernel memory, potentially causing system crashes, memory corruption, or privilege escalation. The CVSS vector indicates local attack vector with low complexity and low privileges required, no user interaction, and high impact on confidentiality, integrity, and availability.
Mitigation Recommendations
A fix has been implemented in the Linux kernel to synchronize pending irq_work before freeing the ring buffer, eliminating the race condition. Users should apply the official kernel updates that include this fix. Patch status is not explicitly confirmed here; check the Linux kernel vendor advisory or source repository for the exact fixed versions and apply updates accordingly.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-7wgc-5744-4jc8
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2025-40319"]
- Database Specific Severity
- HIGH
- Cvss Version
- 3.1
Threat ID: 6a6b72d49c2644c7f847923b
Added to database: 07/30/2026, 15:50:44 UTC
Last enriched: 07/30/2026, 17:52:47 UTC
Last updated: 09/10/2026, 19:38:47 UTC
Views: 18
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.