From: Li Wang <liwang@kylinos.cn>
To: Joanne Koong <joannelkoong@gmail.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
Bernd Schubert <bernd@bsbernd.com>,
fuse-devel@lists.linux.dev, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fuse: fix kernel NULL pointer dereference in fuse_uring_add_to_pq()
Date: Thu, 23 Apr 2026 14:44:21 +0800 [thread overview]
Message-ID: <7f435631-931a-43a7-b1e5-e736c5527459@kylinos.cn> (raw)
In-Reply-To: <CAJnrk1bfCM3kF83mA5z4iPcw+w1_MHbrF4X2K7kLNRagtPD=XQ@mail.gmail.com>
Hi Joanne,
On 23/04/2026 03:18, Joanne Koong wrote:
>
> Thanks for testing/reporting this! This lgtm but afaict, the patches
> in that patchset aren't finalized yet so imo it'd be cleaner if this
> gets folded into the original patch [1] instead of being its own
> separate commit.
>
> I think using fuse_pqueue_alloc() ends up being a tad bit cleaner
>
Thanks for the feedback. I'm fine with either way (fold or split),
and I will follow your suggestions and send out a v2.
Thanks,
Li
> diff --git a/fs/fuse/dev_uring.c b/fs/fuse/dev_uring.c
> index 5abf447e9710..e467b23e6895 100644
> --- a/fs/fuse/dev_uring.c
> +++ b/fs/fuse/dev_uring.c
> @@ -277,7 +277,7 @@ static struct fuse_ring_queue
> *fuse_uring_create_queue(struct fuse_ring *ring,
> queue = kzalloc_obj(*queue, GFP_KERNEL_ACCOUNT);
> if (!queue)
> return NULL;
> - pq = kzalloc_objs(struct list_head, FUSE_PQ_HASH_SIZE);
> + pq = fuse_pqueue_alloc();
> if (!pq) {
> kfree(queue);
> return NULL;
> @@ -295,8 +295,8 @@ static struct fuse_ring_queue
> *fuse_uring_create_queue(struct fuse_ring *ring,
> INIT_LIST_HEAD(&queue->fuse_req_bg_queue);
> INIT_LIST_HEAD(&queue->ent_released);
>
> - queue->fpq.processing = pq;
> fuse_pqueue_init(&queue->fpq);
> + queue->fpq.processing = pq;
>
> after exporting fuse_pqueue_alloc() into fuse_dev_i.h
>
> Thanks,
> Joanne
>
> [1] https://lore.kernel.org/fuse-devel/20260416091658.462783-32-mszeredi@redhat.com/
next prev parent reply other threads:[~2026-04-23 6:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-22 10:36 Li Wang
2026-04-22 11:18 ` Jingbo Xu
2026-04-23 1:52 ` Li Wang
2026-04-22 11:39 ` Bernd Schubert
2026-04-23 2:04 ` Li Wang
2026-04-22 19:18 ` Joanne Koong
2026-04-23 6:44 ` Li Wang [this message]
2026-04-23 7:17 ` Miklos Szeredi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7f435631-931a-43a7-b1e5-e736c5527459@kylinos.cn \
--to=liwang@kylinos.cn \
--cc=bernd@bsbernd.com \
--cc=fuse-devel@lists.linux.dev \
--cc=joannelkoong@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®