proc: fix oops on invalid /proc/<pid>/maps access, CVE-2011-1020
[linux-flexiantxendom0-natty.git] / fs / proc / task_mmu.c
index 77e7bb9..7f5e572 100644 (file)
@@ -180,7 +180,8 @@ static void m_stop(struct seq_file *m, void *v)
        struct proc_maps_private *priv = m->private;
        struct vm_area_struct *vma = v;
 
-       vma_stop(priv, vma);
+       if (!IS_ERR(vma))
+               vma_stop(priv, vma);
        if (priv->task)
                put_task_struct(priv->task);
 }