fuse: fix fileattr op failure
authorMiklos Szeredi <mszeredi@redhat.com>
Fri, 18 Feb 2022 10:47:51 +0000 (11:47 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Mar 2022 13:23:42 +0000 (14:23 +0100)
commitd60d34b4d6d1227923bcbe6fdba24c2f03ce69cf
treef1587156b0520c481ed4e90804080385a9f8fb53
parent64147ce85e2fe7cbae91e712c329c85c55801561
fuse: fix fileattr op failure

commit a679a61520d8a7b0211a1da990404daf5cc80b72 upstream.

The fileattr API conversion broke lsattr on ntfs3g.

Previously the ioctl(... FS_IOC_GETFLAGS) returned an EINVAL error, but
after the conversion the error returned by the fuse filesystem was not
propagated back to the ioctl() system call, resulting in success being
returned with bogus values.

Fix by checking for outarg.result in fuse_priv_ioctl(), just as generic
ioctl code does.

Reported-by: Jean-Pierre André <jean-pierre.andre@wanadoo.fr>
Fixes: 72227eac177d ("fuse: convert to fileattr")
Cc: <stable@vger.kernel.org> # v5.13
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/fuse/ioctl.c