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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
Signed-off-by: Bernd Schubert <bschubert@xxxxxxx>
---
 fs/fuse/dev_uring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

-- 
2.43.0





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux