From: Bernd Schubert <bschubert@ddn.com>
To: Joanne Koong <joannelkoong@gmail.com>,
Shuvam Pandey <shuvampandey1@gmail.com>
Cc: miklos@szeredi.hu, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org,
fuse-devel <fuse-devel@lists.linux.dev>,
Zhenghang Xiao <kipreyyy@gmail.com>, Berkant Koc <me@berkoc.com>
Subject: Re: [PATCH] fuse: {io-uring} use request cleanup helper on commit setup failure
Date: Thu, 4 Jun 2026 19:36:15 +0200 [thread overview]
Message-ID: <d486fde6-c78d-4a78-8dbd-43b8afaa90cd@ddn.com> (raw)
In-Reply-To: <CAJnrk1YH_SC9doHp60Vuajc-mzQiopPExMPQVVDtFHzB8vTM6Q@mail.gmail.com>
On 6/4/26 19:33, Joanne Koong wrote:
> On Thu, Jun 4, 2026 at 10:09 AM Shuvam Pandey <shuvampandey1@gmail.com> wrote:
>>
>> fuse_uring_commit_fetch() removes the request from the processing
>> list and clears req->ring_entry before moving the ring entry to the
>> commit state. If fuse_ring_ent_set_commit() fails, the request is
>> currently ended directly with fuse_request_end().
>>
>> That bypasses fuse_uring_req_end(), leaving ent->fuse_req pointing at
>> the ended request. A later ring entry teardown can observe the stale
>> pointer and try to end the same request again.
>>
>> Use fuse_uring_req_end() for this error path as well. The helper clears
>> ent->fuse_req under the queue lock before ending the request, matching
>> the other io_uring request cleanup paths.
>>
>> Fixes: c090c8abae4b ("fuse: Add io-uring sqe commit and fetch support")
>> Cc: stable@vger.kernel.org # v6.14
>> Signed-off-by: Shuvam Pandey <shuvampandey1@gmail.com>
>> ---
>> fs/fuse/dev_uring.c | 4 +---
>> 1 file changed, 1 insertion(+), 3 deletions(-)
>> diff --git a/fs/fuse/dev_uring.c b/fs/fuse/dev_uring.c
>> index 7b9822e88..7523569ff 100644
>> --- a/fs/fuse/dev_uring.c
>> +++ b/fs/fuse/dev_uring.c
>> @@ -924,9 +924,7 @@ static int fuse_uring_commit_fetch(struct io_uring_cmd *cmd, int issue_flags,
>> pr_info_ratelimited("qid=%d commit_id %llu state %d",
>> queue->qid, commit_id, ent->state);
>> spin_unlock(&queue->lock);
>> - req->out.h.error = err;
>> - clear_bit(FR_SENT, &req->flags);
>> - fuse_request_end(req);
>> + fuse_uring_req_end(ent, req, err);
>> return err;
>> }
>>
>
> Hi Shuvam,
>
> There was a similar fix for this submitted a few weeks ago by
> Zhenghang that was sent offlist to security@kernel.org (which I think
> was before the announcement came out to cc the public mailing lists
> when sending fixes to security@). Berkant submitted this fix offlist a
> few days after that as well. Sorry for the duplicate work.
Out of interest, did you see the entire series I had submitted?
Thanks,
Bernd
next prev parent reply other threads:[~2026-06-04 17:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-04 16:55 Shuvam Pandey
2026-06-04 17:33 ` Joanne Koong
2026-06-04 17:36 ` Bernd Schubert [this message]
2026-06-04 17:57 ` Joanne Koong
2026-06-07 10:00 ` Berkant Koc
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=d486fde6-c78d-4a78-8dbd-43b8afaa90cd@ddn.com \
--to=bschubert@ddn.com \
--cc=fuse-devel@lists.linux.dev \
--cc=joannelkoong@gmail.com \
--cc=kipreyyy@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=me@berkoc.com \
--cc=miklos@szeredi.hu \
--cc=shuvampandey1@gmail.com \
/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®