fuse: ioctl: translate ENOSYS in outarg
authorMiklos Szeredi <mszeredi@redhat.com>
Wed, 7 Jun 2023 15:49:21 +0000 (17:49 +0200)
committerMiklos Szeredi <mszeredi@redhat.com>
Wed, 21 Jun 2023 09:17:36 +0000 (11:17 +0200)
commit6a567e920fd0451bf29abc418df96c3365925770
tree8bc6c9ccfcebc13d71eb7cea4f958411ffb88620
parenta9d1c4c6df0e568207907c04aed9e7beb1294c42
fuse: ioctl: translate ENOSYS in outarg

Fuse shouldn't return ENOSYS from its ioctl implementation. If userspace
responds with ENOSYS it should be translated to ENOTTY.

There are two ways to return an error from the IOCTL request:

 - fuse_out_header.error
 - fuse_ioctl_out.result

Commit 02c0cab8e734 ("fuse: ioctl: translate ENOSYS") already fixed this
issue for the first case, but missed the second case.  This patch fixes the
second case.

Reported-by: Jonathan Katz <jkatz@eitmlabs.org>
Closes: https://lore.kernel.org/all/CALKgVmcC1VUV_gJVq70n--omMJZUb4HSh_FqvLTHgNBc+HCLFQ@mail.gmail.com/
Fixes: 02c0cab8e734 ("fuse: ioctl: translate ENOSYS")
Cc: <stable@vger.kernel.org>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/fuse/ioctl.c