CVE-2025-40319 bpf: Sync pending IRQ work before freeing ring buffer

High 7.8 Published Updated

A race condition in the Linux kernel BPF ring buffer allows attackers to trigger a use-after-free, potentially leading to code execution or privilege escalation.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2025-40319?

CVE-2025-40319 is a high-severity use after free vulnerability in Linux, published on 8 Dec 2025. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

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.

Which versions are affected by CVE-2025-40319?

How do I fix CVE-2025-40319?

Apply the vendor's patch.

Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.

Is CVE-2025-40319 being exploited?

There is no known exploitation of CVE-2025-40319 in the wild and no public exploit code.

Sources

Also known as BELL-CVE-2025-40319, DEBIAN-CVE-2025-40319, GHSA-7wgc-5744-4jc8, ROOT-OS-DEBIAN-12-CVE-2025-40319, ROOT-OS-DEBIAN-13-CVE-2025-40319, ROOT-OS-UBUNTU-2204-CVE-2025-40319 and 2 more.

Is CVE-2025-40319 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free