diff options
author | Roger Luethi <rl@hellgate.ch> | 2004-08-22 22:55:22 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-08-22 22:55:22 -0700 |
commit | 1c0e4705187c12d2cb046161e672caa0982464ad (patch) | |
tree | 6a1b5cedbc62dc44b4ccf848654bfc53a2193af2 /fs | |
parent | 13ab6a2b43833fffed9d76203667b04c934f4cdc (diff) | |
download | history-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.c | 2 |
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; |