]> www.infradead.org Git - users/jedix/linux-maple.git/commit
fuse: fix matching of FUSE_DEV_IOC_CLONE command
authorAlessio Balsini <balsini@android.com>
Fri, 19 Mar 2021 15:05:14 +0000 (15:05 +0000)
committerMiklos Szeredi <mszeredi@redhat.com>
Tue, 13 Apr 2021 07:44:08 +0000 (09:44 +0200)
commit6fc4d429aa5ccbd28af65ca556930d42d3443f69
tree5c44fbf1bad53205071ac387845b64a1448fa3ae
parent9b6f4767ed7964927c9512d2d77977f029acdd93
fuse: fix matching of FUSE_DEV_IOC_CLONE command

With commit f8425c939663 ("fuse: 32-bit user space ioctl compat for fuse
device") the matching constraints for the FUSE_DEV_IOC_CLONE ioctl command
are relaxed, limited to the testing of command type and number.  As Arnd
noticed, this is wrong as it wouldn't ensure the correctness of the data
size or direction for the received FUSE device ioctl.

Fix by bringing back the comparison of the ioctl received by the FUSE
device to the originally generated FUSE_DEV_IOC_CLONE.

Fixes: f8425c939663 ("fuse: 32-bit user space ioctl compat for fuse device")
Reported-by: Arnd Bergmann <arnd@kernel.org>
Signed-off-by: Alessio Balsini <balsini@android.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/fuse/dev.c