Merge branch 'stable-3.2' into pandora-3.2
[pandora-kernel.git] / fs / proc / base.c
index 72d16e5..48c7016 100644 (file)
@@ -905,7 +905,8 @@ static ssize_t environ_read(struct file *file, char __user *buf,
 
        mm = mm_for_maps(task);
        ret = PTR_ERR(mm);
-       if (!mm || IS_ERR(mm))
+       /* Ensure the process spawned far enough to have an environment. */
+       if (!mm || IS_ERR(mm) || !mm->env_end)
                goto out_free;
 
        ret = 0;