linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [query] payload size check in fuse_uring_create_ring_ent
@ 2025-10-27 14:49 ALOK TIWARI
  2025-10-27 14:59 ` Bernd Schubert
  0 siblings, 1 reply; 2+ messages in thread
From: ALOK TIWARI @ 2025-10-27 14:49 UTC (permalink / raw)
  To: bschubert, miklos, linux-fsdevel, asml.silence, luis, io-uring
  Cc: alok.a.tiwari

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);


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [query] payload size check in fuse_uring_create_ring_ent
  2025-10-27 14:49 [query] payload size check in fuse_uring_create_ring_ent ALOK TIWARI
@ 2025-10-27 14:59 ` Bernd Schubert
  0 siblings, 0 replies; 2+ messages in thread
From: Bernd Schubert @ 2025-10-27 14:59 UTC (permalink / raw)
  To: ALOK TIWARI, miklos, linux-fsdevel, asml.silence, luis, io-uring



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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-10-27 14:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).