[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251017205546.262475-1-nooraineqbal@gmail.com>
Date: Sat, 18 Oct 2025 02:25:46 +0530
From: neqbal <nooraineqbal@...il.com>
To: syzbot+2617fc732430968b45d2@...kaller.appspotmail.com
Cc: linux-kernel@...r.kernel.org,
syzkaller-bugs@...glegroups.com,
neqbal <nooraineqbal@...il.com>
Subject: [PATCH] bpf: sync pending IRQ work before freeing ring buffer
#syz test
Fix a possible vmalloc out-of-bounds access caused by pending IRQ work
Reported-by: syzbot+2617fc732430968b45d2@...kaller.appspotmail.com
Signed-off-by: neqbal <nooraineqbal@...il.com>
---
kernel/bpf/ringbuf.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/kernel/bpf/ringbuf.c b/kernel/bpf/ringbuf.c
index 719d73299397..a6597417412f 100644
--- a/kernel/bpf/ringbuf.c
+++ b/kernel/bpf/ringbuf.c
@@ -216,6 +216,12 @@ static struct bpf_map *ringbuf_map_alloc(union bpf_attr *attr)
static void bpf_ringbuf_free(struct bpf_ringbuf *rb)
{
+ /* Ensure all pending IRQ work completes before freeing.
+ * In PREEMPT_RT, IRQ work runs in thread context and can
+ * race with ring buffer destruction.
+ */
+ irq_work_sync(&rb->work);
+
/* copy pages pointer and nr_pages to local variable, as we are going
* to unmap rb itself with vunmap() below
*/
--
2.51.0
Powered by blists - more mailing lists