diff options
Diffstat (limited to 'fs/proc/base.c')
-rw-r--r-- | fs/proc/base.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index 8e654468ab67..ca651ac00660 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -252,7 +252,7 @@ static ssize_t proc_pid_cmdline_read(struct file *file, char __user *buf, | |||
252 | * Inherently racy -- command line shares address space | 252 | * Inherently racy -- command line shares address space |
253 | * with code and data. | 253 | * with code and data. |
254 | */ | 254 | */ |
255 | rv = access_remote_vm(mm, arg_end - 1, &c, 1, FOLL_FORCE); | 255 | rv = access_remote_vm(mm, arg_end - 1, &c, 1, 0); |
256 | if (rv <= 0) | 256 | if (rv <= 0) |
257 | goto out_free_page; | 257 | goto out_free_page; |
258 | 258 | ||
@@ -270,8 +270,7 @@ static ssize_t proc_pid_cmdline_read(struct file *file, char __user *buf, | |||
270 | int nr_read; | 270 | int nr_read; |
271 | 271 | ||
272 | _count = min3(count, len, PAGE_SIZE); | 272 | _count = min3(count, len, PAGE_SIZE); |
273 | nr_read = access_remote_vm(mm, p, page, _count, | 273 | nr_read = access_remote_vm(mm, p, page, _count, 0); |
274 | FOLL_FORCE); | ||
275 | if (nr_read < 0) | 274 | if (nr_read < 0) |
276 | rv = nr_read; | 275 | rv = nr_read; |
277 | if (nr_read <= 0) | 276 | if (nr_read <= 0) |
@@ -306,8 +305,7 @@ static ssize_t proc_pid_cmdline_read(struct file *file, char __user *buf, | |||
306 | bool final; | 305 | bool final; |
307 | 306 | ||
308 | _count = min3(count, len, PAGE_SIZE); | 307 | _count = min3(count, len, PAGE_SIZE); |
309 | nr_read = access_remote_vm(mm, p, page, _count, | 308 | nr_read = access_remote_vm(mm, p, page, _count, 0); |
310 | FOLL_FORCE); | ||
311 | if (nr_read < 0) | 309 | if (nr_read < 0) |
312 | rv = nr_read; | 310 | rv = nr_read; |
313 | if (nr_read <= 0) | 311 | if (nr_read <= 0) |
@@ -356,8 +354,7 @@ skip_argv: | |||
356 | bool final; | 354 | bool final; |
357 | 355 | ||
358 | _count = min3(count, len, PAGE_SIZE); | 356 | _count = min3(count, len, PAGE_SIZE); |
359 | nr_read = access_remote_vm(mm, p, page, _count, | 357 | nr_read = access_remote_vm(mm, p, page, _count, 0); |
360 | FOLL_FORCE); | ||
361 | if (nr_read < 0) | 358 | if (nr_read < 0) |
362 | rv = nr_read; | 359 | rv = nr_read; |
363 | if (nr_read <= 0) | 360 | if (nr_read <= 0) |
@@ -835,7 +832,7 @@ static ssize_t mem_rw(struct file *file, char __user *buf, | |||
835 | unsigned long addr = *ppos; | 832 | unsigned long addr = *ppos; |
836 | ssize_t copied; | 833 | ssize_t copied; |
837 | char *page; | 834 | char *page; |
838 | unsigned int flags = FOLL_FORCE; | 835 | unsigned int flags; |
839 | 836 | ||
840 | if (!mm) | 837 | if (!mm) |
841 | return 0; | 838 | return 0; |
@@ -848,6 +845,8 @@ static ssize_t mem_rw(struct file *file, char __user *buf, | |||
848 | if (!atomic_inc_not_zero(&mm->mm_users)) | 845 | if (!atomic_inc_not_zero(&mm->mm_users)) |
849 | goto free; | 846 | goto free; |
850 | 847 | ||
848 | /* Maybe we should limit FOLL_FORCE to actual ptrace users? */ | ||
849 | flags = FOLL_FORCE; | ||
851 | if (write) | 850 | if (write) |
852 | flags |= FOLL_WRITE; | 851 | flags |= FOLL_WRITE; |
853 | 852 | ||
@@ -971,8 +970,7 @@ static ssize_t environ_read(struct file *file, char __user *buf, | |||
971 | max_len = min_t(size_t, PAGE_SIZE, count); | 970 | max_len = min_t(size_t, PAGE_SIZE, count); |
972 | this_len = min(max_len, this_len); | 971 | this_len = min(max_len, this_len); |
973 | 972 | ||
974 | retval = access_remote_vm(mm, (env_start + src), | 973 | retval = access_remote_vm(mm, (env_start + src), page, this_len, 0); |
975 | page, this_len, FOLL_FORCE); | ||
976 | 974 | ||
977 | if (retval <= 0) { | 975 | if (retval <= 0) { |
978 | ret = retval; | 976 | ret = retval; |
@@ -1014,6 +1012,9 @@ static ssize_t auxv_read(struct file *file, char __user *buf, | |||
1014 | { | 1012 | { |
1015 | struct mm_struct *mm = file->private_data; | 1013 | struct mm_struct *mm = file->private_data; |
1016 | unsigned int nwords = 0; | 1014 | unsigned int nwords = 0; |
1015 | |||
1016 | if (!mm) | ||
1017 | return 0; | ||
1017 | do { | 1018 | do { |
1018 | nwords += 2; | 1019 | nwords += 2; |
1019 | } while (mm->saved_auxv[nwords - 2] != 0); /* AT_NULL */ | 1020 | } while (mm->saved_auxv[nwords - 2] != 0); /* AT_NULL */ |