Commit 1c0e4705 authored by Roger Luethi's avatar Roger Luethi Committed by Linus Torvalds

[PATCH] proc_pid_cmdline() race fix

If you win the race with a starting process, you can read its environment.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 13ab6a2b
...@@ -328,6 +328,8 @@ static int proc_pid_cmdline(struct task_struct *task, char * buffer) ...@@ -328,6 +328,8 @@ static int proc_pid_cmdline(struct task_struct *task, char * buffer)
struct mm_struct *mm = get_task_mm(task); struct mm_struct *mm = get_task_mm(task);
if (!mm) if (!mm)
goto out; goto out;
if (!mm->arg_end)
goto out; /* Shh! No looking before we're done */
len = mm->arg_end - mm->arg_start; len = mm->arg_end - mm->arg_start;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment