bpf: Sync pending IRQ work before freeing ring buffer
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 457f44363a8894135c85b7a9afd2bd8196db24ab · < 430e15544f11f8de26b2b5109c7152f71b78295e| No fix yet |
| Linux Linux |
|
|
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.
From the CVE record · Linux
The Linux kernel has a race between BPF ring-buffer cleanup and pending IRQ work. A BPF program attached to sched_switch can queue work through bpf_ringbuf_commit(); if the ring buffer is freed before that work runs, the work may access freed memory. The input does not specify authentication requirements or whether user interaction is needed.
Teams running Linux kernels with BPF ring-buffer support should check whether their kernel is affected; affected versions are not specified.