io-uring.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bernd Schubert <bschubert@ddn.com>
To: ALOK TIWARI <alok.a.tiwari@oracle.com>,
	miklos@szeredi.hu, linux-fsdevel@vger.kernel.org,
	asml.silence@gmail.com, luis@igalia.com,
	io-uring@vger.kernel.org
Subject: Re: [query] payload size check in fuse_uring_create_ring_ent
Date: Mon, 27 Oct 2025 15:59:11 +0100	[thread overview]
Message-ID: <b2f94e18-7a70-412f-a242-aace942b0b68@ddn.com> (raw)
In-Reply-To: <04b7104c-95e3-4b0c-a8a2-f240a1994c68@oracle.com>



On 10/27/25 15:49, ALOK TIWARI wrote:
> [You don't often get email from alok.a.tiwari@oracle.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
> 
> Hi,
> 
> I am wondering if this condition is intentional.
> It seems that ring->max_payload_sz represents the maximum allowed
> payload size, so rejecting payloads smaller than that looks unexpected.
> 
> Could you please confirm whether the current < check is correct or
> if this should be > instead?
> 
> 24fe962c86f5 ("fuse: {io-uring} Handle SQEs - register commands")
> 
> Thanks,
> Alok
> ---
> diff --git a/fs/fuse/dev_uring.c b/fs/fuse/dev_uring.c
> index f6b12aebb8bb..4106fc80c1e8 100644
> --- a/fs/fuse/dev_uring.c
> +++ b/fs/fuse/dev_uring.c
> @@ -1051,7 +1051,7 @@ fuse_uring_create_ring_ent(struct io_uring_cmd *cmd,
>          }
> 
>          payload_size = iov[1].iov_len;
> -       if (payload_size < ring->max_payload_sz) {
> +       if (payload_size > ring->max_payload_sz) {
>                  pr_info_ratelimited("Invalid req payload len %zu\n",
>                                      payload_size);
> 

See the calculation of of ring->max_payload_sz in fuse_uring_create(), i.e.
it determines the maximum payload an entry buffer could ever have.

We don't care if fuse-server made a mistake and uses 
payload_size > ring->max_payload_sz, just a waste of memory then. Though,
if payload_size < ring->max_payload_sz, it could not handle IO sizes given
by  fc->max_write, fc->max_pages or FUSE_MIN_READ_BUFFER.


Thanks,
Bernd

      reply	other threads:[~2025-10-27 14:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-27 14:49 [query] payload size check in fuse_uring_create_ring_ent ALOK TIWARI
2025-10-27 14:59 ` Bernd Schubert [this message]

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=b2f94e18-7a70-412f-a242-aace942b0b68@ddn.com \
    --to=bschubert@ddn.com \
    --cc=alok.a.tiwari@oracle.com \
    --cc=asml.silence@gmail.com \
    --cc=io-uring@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=luis@igalia.com \
    --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;
as well as URLs for NNTP newsgroup(s).