瀏覽代碼

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 <viro@zeniv.linux.org.uk>
Al Viro 11 年之前
父節點
當前提交
ec69557982
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      fs/exec.c

+ 1 - 1
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 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)
 	if (res > 0)
 		flush_icache_range(addr, addr + len);
 		flush_icache_range(addr, addr + len);
 	return res;
 	return res;