summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorChris Mason <clm@meta.com>2026-06-05 22:27:06 +0300
committerMiklos Szeredi <mszeredi@redhat.com>2026-06-15 15:06:13 +0300
commit3a0a8bc51a13951c5141262bf770eeea3e0b6228 (patch)
tree2aa8046d53f53df19276176ee1972daddd520072 /include/linux
parent4dd6f6d3085a84e74b0a1efec3a05ed0b5125dce (diff)
downloadlinux-3a0a8bc51a13951c5141262bf770eeea3e0b6228.tar.xz
fuse-uring: fix EFAULT clobber in fuse_uring_commit
copy_from_user() returns the number of bytes not copied as an unsigned residual on failure (1..sizeof(struct fuse_out_header)). fuse_uring_commit stores that residual in ssize_t err, sets req->out.h.error to -EFAULT, then jumps to out: with err still holding the positive residual. err = copy_from_user(&req->out.h, &ent->headers->in_out, sizeof(req->out.h)); if (err) { req->out.h.error = -EFAULT; goto out; /* err is the positive residual */ } ... out: fuse_uring_req_end(ent, req, err); fuse_uring_req_end() then runs if (error) req->out.h.error = error; which overwrites the just-assigned -EFAULT with the positive residual. FUSE callers such as fuse_simple_request() test err < 0 to detect failure, so the positive value is interpreted as success and the caller proceeds with an uninitialised or partial req->out.args. Fix by assigning err = -EFAULT in the failure branch before jumping to out, so fuse_uring_req_end() receives a negative errno and sets req->out.h.error to -EFAULT. Fixes: c090c8abae4b ("fuse: Add io-uring sqe commit and fetch support") Cc: stable@vger.kernel.org Reviewed-by: Joanne Koong <joannelkoong@gmail.com> Assisted-by: kres (claude-opus-4-7) Signed-off-by: Chris Mason <clm@meta.com> Reviewed-by: Bernd Schubert <bernd@bsbernd.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions