new helper: read_code()
switch binfmts that use ->read() to that (and to kernel_read() in several cases in binfmt_flat - sure, it's nommu, but still, doing ->read() into kmalloc'ed buffer...) Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -802,6 +802,15 @@ int kernel_read(struct file *file, loff_t offset,
|
||||
|
||||
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);
|
||||
if (res > 0)
|
||||
flush_icache_range(addr, addr + len);
|
||||
return res;
|
||||
}
|
||||
EXPORT_SYMBOL(read_code);
|
||||
|
||||
static int exec_mmap(struct mm_struct *mm)
|
||||
{
|
||||
struct task_struct *tsk;
|
||||
|
Reference in New Issue
Block a user