diff mbox series

[1/5] fuse: Fix copy_from_user error return code in fuse_uring_commit

Message ID 20250123-fuse-uring-for-6-14-incremental-to-v10-v1-1-8aee9f27c066@ddn.com (mailing list archive)
State New
Headers show
Series fuse: over-io-uring fixes | expand

Commit Message

Bernd Schubert Jan. 23, 2025, 4:55 p.m. UTC
Return code was accidentally set to the result, which
can be a positive value with the number of bytes that
could not be copied. Set to -EFAULT.

Fixes: fuse: Add io-uring sqe commit and fetch support
Spotted in review by: Luis Henriques <luis@igalia.com>
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
---
 fs/fuse/dev_uring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fs/fuse/dev_uring.c b/fs/fuse/dev_uring.c
index 5f10f3880d5a4869d8a040567025c60e75d962c6..8e15acb3d350d223c64423233f3613b6eee075da 100644
--- a/fs/fuse/dev_uring.c
+++ b/fs/fuse/dev_uring.c
@@ -779,7 +779,7 @@  static void fuse_uring_commit(struct fuse_ring_ent *ent,
 	err = copy_from_user(&req->out.h, &ent->headers->in_out,
 			     sizeof(req->out.h));
 	if (err) {
-		req->out.h.error = err;
+		req->out.h.error = -EFAULT;
 		goto out;
 	}