]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
fix up queue-5.15/bpf-sync-pending-irq-work-before-freeing-ring-buffer.patch
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Nov 2025 22:45:24 +0000 (07:45 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Nov 2025 22:45:24 +0000 (07:45 +0900)
queue-5.15/bpf-sync-pending-irq-work-before-freeing-ring-buffer.patch

index 8ea97f9b2fcac34b0f99891ab183da187f0d690c..1b91503880fdd80296e0ec99b91897d259d23b2e 100644 (file)
@@ -25,22 +25,17 @@ Link: https://lore.kernel.org/r/20251020180301.103366-1-nooraineqbal@gmail.com
 Signed-off-by: Alexei Starovoitov <ast@kernel.org>
 Signed-off-by: Sasha Levin <sashal@kernel.org>
 ---
- kernel/bpf/ringbuf.c | 2 ++
+ kernel/bpf/ringbuf.c |    2 ++
  1 file changed, 2 insertions(+)
 
-diff --git a/kernel/bpf/ringbuf.c b/kernel/bpf/ringbuf.c
-index eb6ff0d0c06b6..5798d6dbdcb43 100644
 --- a/kernel/bpf/ringbuf.c
 +++ b/kernel/bpf/ringbuf.c
-@@ -184,6 +184,8 @@ static struct bpf_map *ringbuf_map_alloc(union bpf_attr *attr)
+@@ -190,6 +190,8 @@ static void bpf_ringbuf_free(struct bpf_
+       struct page **pages = rb->pages;
+       int i, nr_pages = rb->nr_pages;
  
- static void bpf_ringbuf_free(struct bpf_ringbuf *rb)
- {
 +      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
-
+       vunmap(rb);
+       for (i = 0; i < nr_pages; i++)
+               __free_page(pages[i]);