exec: use flush_icache_user_range in read_code
authorChristoph Hellwig <hch@lst.de>
Mon, 8 Jun 2020 04:42:43 +0000 (21:42 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 8 Jun 2020 18:05:58 +0000 (11:05 -0700)
read_code operates on user addresses.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Link: http://lkml.kernel.org/r/20200515143646.3857579-27-hch@lst.de
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/exec.c

index 88260ec0ac34310b092dd2303d95191656c872c4..02d0c5d19be582efc988bd0c3dc1531639257ea4 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -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);
        if (res > 0)
-               flush_icache_range(addr, addr + len);
+               flush_icache_user_range(addr, addr + len);
        return res;
 }
 EXPORT_SYMBOL(read_code);