Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm/nommu: switch do_mmap_private to kernel_read

Instead of playing with the address limit. This also gains us
validation of the kvec and proper atime updates.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

authored by

Christoph Hellwig and committed by
Al Viro
b4bf802a 9a779bc1

+1 -6
+1 -6
mm/nommu.c
··· 1164 1164 1165 1165 if (vma->vm_file) { 1166 1166 /* read the contents of a file into the copy */ 1167 - mm_segment_t old_fs; 1168 1167 loff_t fpos; 1169 1168 1170 1169 fpos = vma->vm_pgoff; 1171 1170 fpos <<= PAGE_SHIFT; 1172 1171 1173 - old_fs = get_fs(); 1174 - set_fs(KERNEL_DS); 1175 - ret = __vfs_read(vma->vm_file, base, len, &fpos); 1176 - set_fs(old_fs); 1177 - 1172 + ret = kernel_read(vma->vm_file, base, len, &fpos); 1178 1173 if (ret < 0) 1179 1174 goto error_free; 1180 1175