lkml.org 
[lkml]   [2017]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 09/17] mm/nommu: switch do_mmap_private to kernel_read
Date
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>
---
mm/nommu.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/mm/nommu.c b/mm/nommu.c
index fc184f597d59..e907a25ec9bd 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -1164,17 +1164,12 @@ static int do_mmap_private(struct vm_area_struct *vma,

if (vma->vm_file) {
/* read the contents of a file into the copy */
- mm_segment_t old_fs;
loff_t fpos;

fpos = vma->vm_pgoff;
fpos <<= PAGE_SHIFT;

- old_fs = get_fs();
- set_fs(KERNEL_DS);
- ret = __vfs_read(vma->vm_file, base, len, &fpos);
- set_fs(old_fs);
-
+ ret = kernel_read(vma->vm_file, base, len, &fpos);
if (ret < 0)
goto error_free;

--
2.11.0
\
 
 \ /
  Last update: 2017-09-01 17:47    [W:0.095 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site