aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorRoger Luethi <rl@hellgate.ch>2004-08-22 22:55:22 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-08-22 22:55:22 -0700
commit1c0e4705187c12d2cb046161e672caa0982464ad (patch)
tree6a1b5cedbc62dc44b4ccf848654bfc53a2193af2 /fs
parent13ab6a2b43833fffed9d76203667b04c934f4cdc (diff)
downloadhistory-1c0e4705187c12d2cb046161e672caa0982464ad.tar.gz
[PATCH] proc_pid_cmdline() race fix
If you win the race with a starting process, you can read its environment. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/proc/base.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 3d2f5e8fbc58a3..0b70c615bac301 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -328,6 +328,8 @@ static int proc_pid_cmdline(struct task_struct *task, char * buffer)
struct mm_struct *mm = get_task_mm(task);
if (!mm)
goto out;
+ if (!mm->arg_end)
+ goto out; /* Shh! No looking before we're done */
len = mm->arg_end - mm->arg_start;