Commit cbbf50f0 authored by Dave Jones's avatar Dave Jones Committed by Linus Torvalds

[PATCH] Fix mprotect bogus check.

If we want to trap NULL vma's, we'd better be sure
that we don't dereference it first..
parent 62b6df25
...@@ -114,10 +114,11 @@ static int ...@@ -114,10 +114,11 @@ static int
mprotect_attempt_merge(struct vm_area_struct *vma, struct vm_area_struct *prev, mprotect_attempt_merge(struct vm_area_struct *vma, struct vm_area_struct *prev,
unsigned long end, int newflags) unsigned long end, int newflags)
{ {
struct mm_struct * mm = vma->vm_mm; struct mm_struct * mm;
if (!prev || !vma) if (!prev || !vma)
return 0; return 0;
mm = vma->vm_mm;
if (prev->vm_end != vma->vm_start) if (prev->vm_end != vma->vm_start)
return 0; return 0;
if (!can_vma_merge(prev, newflags)) if (!can_vma_merge(prev, newflags))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment