[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAADnVQ+pXhEsumx6NapCU0sCJw9vdB3TdLMLtCoHa7_sqCRH1A@mail.gmail.com>
Date: Sat, 18 Oct 2025 18:13:02 -0700
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: neqbal <nooraineqbal@...il.com>
Cc: Alexei Starovoitov <ast@...nel.org>, Andrii Nakryiko <andrii@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>, Martin KaFai Lau <martin.lau@...ux.dev>, Eduard <eddyz87@...il.com>,
Song Liu <song@...nel.org>, Yonghong Song <yonghong.song@...ux.dev>,
John Fastabend <john.fastabend@...il.com>, KP Singh <kpsingh@...nel.org>,
Stanislav Fomichev <sdf@...ichev.me>, Hao Luo <haoluo@...gle.com>, Jiri Olsa <jolsa@...nel.org>,
bpf <bpf@...r.kernel.org>, LKML <linux-kernel@...r.kernel.org>,
Shuah Khan <skhan@...uxfoundation.org>, david.hunter@...uxfoundation.org,
syzbot+2617fc732430968b45d2@...kaller.appspotmail.com,
linux-kernel-mentees@...ts.linux.dev
Subject: Re: [PATCH] bpf: sync pending IRQ work before freeing ring buffer
On Sat, Oct 18, 2025 at 11:12 AM neqbal <nooraineqbal@...il.com> wrote:
>
> Fix a possible vmalloc out-of-bounds access caused by pending IRQ work
> by ensuring all pending IRQ work completes before freeing.
>
> Fixes: 457f44363a88 ("bpf: Implement BPF ring buffer and verifier support for it")
> Reported-by: syzbot+2617fc732430968b45d2@...kaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=2617fc732430968b45d2
Why do you think irq_work_run_list() processes bpf ringbuf in
the above splat?
> Tested-by: syzbot+2617fc732430968b45d2@...kaller.appspotmail.com
> Signed-off-by: neqbal <nooraineqbal@...il.com>
Use your real name.
> ---
> kernel/bpf/ringbuf.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/kernel/bpf/ringbuf.c b/kernel/bpf/ringbuf.c
> index 719d73299397..d706c4b7f532 100644
> --- a/kernel/bpf/ringbuf.c
> +++ b/kernel/bpf/ringbuf.c
> @@ -216,6 +216,8 @@ static struct bpf_map *ringbuf_map_alloc(union bpf_attr *attr)
>
> static void bpf_ringbuf_free(struct bpf_ringbuf *rb)
> {
> + irq_work_sync(&rb->work);
Sort-of kind-of makes sense, but bpf_ringbuf_free() is called
when no references to bpf map are left. User space and bpf progs
are not using it anymore, so irq_work callbacks should have completed
long ago.
pw-bot: cr
Powered by blists - more mailing lists