aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/base.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index c28281102082..fc471b8766d1 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -919,20 +919,18 @@ static ssize_t environ_read(struct file *file, char __user *buf,
919 if (!task) 919 if (!task)
920 goto out_no_task; 920 goto out_no_task;
921 921
922 if (!ptrace_may_access(task, PTRACE_MODE_READ))
923 goto out;
924
925 ret = -ENOMEM; 922 ret = -ENOMEM;
926 page = (char *)__get_free_page(GFP_TEMPORARY); 923 page = (char *)__get_free_page(GFP_TEMPORARY);
927 if (!page) 924 if (!page)
928 goto out; 925 goto out;
929 926
930 ret = 0;
931 927
932 mm = get_task_mm(task); 928 mm = mm_for_maps(task);
933 if (!mm) 929 ret = PTR_ERR(mm);
930 if (!mm || IS_ERR(mm))
934 goto out_free; 931 goto out_free;
935 932
933 ret = 0;
936 while (count > 0) { 934 while (count > 0) {
937 int this_len, retval, max_len; 935 int this_len, retval, max_len;
938 936