Fix mprotect bogus check.

From: Dave Jones
Date: Fri Apr 16 2004 - 16:00:39 EST


If we want to trap NULL vma's, we'd better be sure
that we don't dereference it first..

Dave

--- linux-2.6.5/mm/mprotect.c~ 2004-04-16 21:52:47.000000000 +0100
+++ linux-2.6.5/mm/mprotect.c 2004-04-16 21:53:12.000000000 +0100
@@ -114,10 +114,11 @@
mprotect_attempt_merge(struct vm_area_struct *vma, struct vm_area_struct *prev,
unsigned long end, int newflags)
{
- struct mm_struct * mm = vma->vm_mm;
+ struct mm_struct * mm;

if (!prev || !vma)
return 0;
+ mm = vma->vm_mm;
if (prev->vm_end != vma->vm_start)
return 0;
if (!can_vma_merge(prev, newflags))
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/