The patch titled /proc/*/environ: wrong placing of ptrace_may_attach() check has been added to the -mm tree. Its filename is proc-environ-wrong-placing-of-ptrace_may_attach-check.patch *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: /proc/*/environ: wrong placing of ptrace_may_attach() check From: Alexey Dobriyan <adobriyan@xxxxx> Signed-off-by: Alexey Dobriyan <adobriyan@xxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/proc/base.c | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff -puN fs/proc/base.c~proc-environ-wrong-placing-of-ptrace_may_attach-check fs/proc/base.c --- a/fs/proc/base.c~proc-environ-wrong-placing-of-ptrace_may_attach-check +++ a/fs/proc/base.c @@ -204,12 +204,17 @@ static int proc_pid_environ(struct task_ int res = 0; struct mm_struct *mm = get_task_mm(task); if (mm) { - unsigned int len = mm->env_end - mm->env_start; + unsigned int len; + + res = -ESRCH; + if (!ptrace_may_attach(task)) + goto out; + + len = mm->env_end - mm->env_start; if (len > PAGE_SIZE) len = PAGE_SIZE; res = access_process_vm(task, mm->env_start, buffer, len, 0); - if (!ptrace_may_attach(task)) - res = -ESRCH; +out: mmput(mm); } return res; _ Patches currently in -mm which might be from adobriyan@xxxxx are fix-vmic-compilation.patch fix-rmmod-read-write-races-in-proc-entries.patch fix-rmmod-read-write-races-in-proc-entries-cleanup.patch fix-rmmod-read-write-races-in-proc-entries-fix.patch proc-environ-wrong-placing-of-ptrace_may_attach-check.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html