Commit bce2b68b authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Linus Torvalds

exec: use flush_icache_user_range in read_code

read_code operates on user addresses.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Link: http://lkml.kernel.org/r/20200515143646.3857579-27-hch@lst.deSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 48304f79
...@@ -1059,7 +1059,7 @@ ssize_t read_code(struct file *file, unsigned long addr, loff_t pos, size_t len) ...@@ -1059,7 +1059,7 @@ ssize_t read_code(struct file *file, unsigned long addr, loff_t pos, size_t len)
{ {
ssize_t res = vfs_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_user_range(addr, addr + len);
return res; return res;
} }
EXPORT_SYMBOL(read_code); EXPORT_SYMBOL(read_code);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment