[PATCH 04/20] FIEMAP: don't bother with access_ok()

From: Al Viro
Date: Sat May 09 2020 - 19:46:28 EST


From: Al Viro <viro@xxxxxxxxxxxxxxxxxx>

we use copy_to_user() on that thing anyway (and always had).

Signed-off-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
---
fs/ext4/ioctl.c | 5 -----
fs/ioctl.c | 5 -----
2 files changed, 10 deletions(-)

diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
index bfc1281fc4cb..a0afd0338722 100644
--- a/fs/ext4/ioctl.c
+++ b/fs/ext4/ioctl.c
@@ -784,11 +784,6 @@ static int ext4_ioctl_get_es_cache(struct file *filp, unsigned long arg)
fieinfo.fi_extents_max = fiemap.fm_extent_count;
fieinfo.fi_extents_start = ufiemap->fm_extents;

- if (fiemap.fm_extent_count != 0 &&
- !access_ok(fieinfo.fi_extents_start,
- fieinfo.fi_extents_max * sizeof(struct fiemap_extent)))
- return -EFAULT;
-
if (fieinfo.fi_flags & FIEMAP_FLAG_SYNC)
filemap_write_and_wait(inode->i_mapping);

diff --git a/fs/ioctl.c b/fs/ioctl.c
index 282d45be6f45..f8181e2c2168 100644
--- a/fs/ioctl.c
+++ b/fs/ioctl.c
@@ -215,11 +215,6 @@ static int ioctl_fiemap(struct file *filp, struct fiemap __user *ufiemap)
fieinfo.fi_extents_max = fiemap.fm_extent_count;
fieinfo.fi_extents_start = ufiemap->fm_extents;

- if (fiemap.fm_extent_count != 0 &&
- !access_ok(fieinfo.fi_extents_start,
- fieinfo.fi_extents_max * sizeof(struct fiemap_extent)))
- return -EFAULT;
-
if (fieinfo.fi_flags & FIEMAP_FLAG_SYNC)
filemap_write_and_wait(inode->i_mapping);

--
2.11.0