fat_dir_ioctl(): hadn't needed that access_ok() for more than a decade...
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 19 Feb 2020 04:05:39 +0000 (23:05 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 9 May 2020 19:57:04 +0000 (15:57 -0400)
address is passed only to put_user() and copy_to_user()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/fat/dir.c

index 054acd9fd0331dc0ba6ad74473c4d5117569ff60..b4ddf48fa4449db8f67fa38e7f037d3c6b93d0ca 100644 (file)
@@ -804,8 +804,6 @@ static long fat_dir_ioctl(struct file *filp, unsigned int cmd,
                return fat_generic_ioctl(filp, cmd, arg);
        }
 
-       if (!access_ok(d1, sizeof(struct __fat_dirent[2])))
-               return -EFAULT;
        /*
         * Yes, we don't need this put_user() absolutely. However old
         * code didn't return the right value. So, app use this value,
@@ -844,8 +842,6 @@ static long fat_compat_dir_ioctl(struct file *filp, unsigned cmd,
                return fat_generic_ioctl(filp, cmd, (unsigned long)arg);
        }
 
-       if (!access_ok(d1, sizeof(struct compat_dirent[2])))
-               return -EFAULT;
        /*
         * Yes, we don't need this put_user() absolutely. However old
         * code didn't return the right value. So, app use this value,