Skip to content

Conversation

kernel-patches-daemon-bpf[bot]
Copy link

Pull request for series with
subject: bpf: sync pending IRQ work before freeing ring buffer
version: 2
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1013707

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 7361c86
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1013707
version: 2

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 04a8995
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1013707
version: 2

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 04a8995
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1013707
version: 2

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

Fixes: 457f443 ("bpf: Implement BPF ring buffer and verifier support for it")
Reported-by: [email protected]
Closes: https://syzkaller.appspot.com/bug?extid=2617fc732430968b45d2
Tested-by: [email protected]
Signed-off-by: Noorain Eqbal <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant