Message ID | 1311254026-29719-10-git-send-email-apw@canonical.com |
---|---|
State | New |
Headers | show |
diff --git a/fs/proc/base.c b/fs/proc/base.c index e60289b..1953009 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -922,20 +922,18 @@ static ssize_t environ_read(struct file *file, char __user *buf, if (!task) goto out_no_task; - if (!ptrace_may_access(task, PTRACE_MODE_READ)) - goto out; - ret = -ENOMEM; page = (char *)__get_free_page(GFP_TEMPORARY); if (!page) goto out; - ret = 0; - mm = get_task_mm(task); - if (!mm) + mm = mm_for_maps(task); + ret = PTR_ERR(mm); + if (!mm || IS_ERR(mm)) goto out_free; + ret = 0; while (count > 0) { int this_len, retval, max_len;