diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2020-02-19 04:34:07 +0100 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2020-05-02 02:29:54 +0200 |
commit | 5fb1514164de20ddb21886ffceda4cb54d6538f6 (patch) | |
tree | ae89fc9a4477fcdb1675bfb202807a36e2c956ca /fs/readdir.c | |
parent | readdir.c: get compat_filldir() more or less in sync with filldir() (diff) | |
download | linux-5fb1514164de20ddb21886ffceda4cb54d6538f6.tar.xz linux-5fb1514164de20ddb21886ffceda4cb54d6538f6.zip |
readdir.c: get rid of the last __put_user(), drop now-useless access_ok()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/readdir.c')
-rw-r--r-- | fs/readdir.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/fs/readdir.c b/fs/readdir.c index 9534675880ce..a49f07c11cfb 100644 --- a/fs/readdir.c +++ b/fs/readdir.c @@ -276,9 +276,6 @@ SYSCALL_DEFINE3(getdents, unsigned int, fd, }; int error; - if (!access_ok(dirent, count)) - return -EFAULT; - f = fdget_pos(fd); if (!f.file) return -EBADF; @@ -362,9 +359,6 @@ int ksys_getdents64(unsigned int fd, struct linux_dirent64 __user *dirent, }; int error; - if (!access_ok(dirent, count)) - return -EFAULT; - f = fdget_pos(fd); if (!f.file) return -EBADF; @@ -377,7 +371,7 @@ int ksys_getdents64(unsigned int fd, struct linux_dirent64 __user *dirent, typeof(lastdirent->d_off) d_off = buf.ctx.pos; lastdirent = (void __user *) buf.current_dir - buf.prev_reclen; - if (__put_user(d_off, &lastdirent->d_off)) + if (put_user(d_off, &lastdirent->d_off)) error = -EFAULT; else error = count - buf.count; @@ -537,9 +531,6 @@ COMPAT_SYSCALL_DEFINE3(getdents, unsigned int, fd, }; int error; - if (!access_ok(dirent, count)) - return -EFAULT; - f = fdget_pos(fd); if (!f.file) return -EBADF; |