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

index 4512f870fd42735b04cf63624281eb852ecb94e1..65e1c53f8e433d4d41890ecae902fd5eddf86ff0 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 eac0026e2fa62..12e2aad376cf5 100644
 --- a/kernel/bpf/ringbuf.c
 +++ b/kernel/bpf/ringbuf.c
-@@ -203,6 +203,8 @@ static struct bpf_map *ringbuf_map_alloc(union bpf_attr *attr)
+@@ -209,6 +209,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]);