From: Al Viro Date: Wed, 5 Feb 2014 00:08:21 +0000 (-0500) Subject: read_code(): go through vfs_read() instead of calling the method directly X-Git-Tag: firefly_0821_release~176^2~4070^2~29 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=ec69557982563c97b3a7d68dd271be5105b83869;p=firefly-linux-kernel-4.4.55.git read_code(): go through vfs_read() instead of calling the method directly ... and don't skip on sanity checks. It's *not* a hot path, TYVM (a couple of calls per a.out execve(), for pity sake) and headers of random a.out binary are not to be trusted. Signed-off-by: Al Viro --- diff --git a/fs/exec.c b/fs/exec.c index 3d78fccdd723..4cc94534ed5b 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -810,7 +810,7 @@ EXPORT_SYMBOL(kernel_read); ssize_t read_code(struct file *file, unsigned long addr, loff_t pos, size_t len) { - ssize_t res = file->f_op->read(file, (void __user *)addr, len, &pos); + ssize_t res = vfs_read(file, (void __user *)addr, len, &pos); if (res > 0) flush_icache_range(addr, addr + len); return res;