dect
/
linux-2.6
Archived
13
0
Fork 0

[PATCH] Fix MPOL_F_VERIFY

There was a pretty bad bug in there that the code would always check the full
VMA, not the range the user requested.

When the VMA to be checked was merged with the previous VMA this could lead to
spurious failures.

Signed-off-by: "Andi Kleen" <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Andi Kleen 2005-09-13 01:25:08 -07:00 committed by Linus Torvalds
parent 8d0986e289
commit 5b952b3c14
1 changed files with 6 additions and 1 deletions

View File

@ -333,8 +333,13 @@ check_range(struct mm_struct *mm, unsigned long start, unsigned long end,
if (prev && prev->vm_end < vma->vm_start)
return ERR_PTR(-EFAULT);
if ((flags & MPOL_MF_STRICT) && !is_vm_hugetlb_page(vma)) {
unsigned long endvma = vma->vm_end;
if (endvma > end)
endvma = end;
if (vma->vm_start > start)
start = vma->vm_start;
err = check_pgd_range(vma->vm_mm,
vma->vm_start, vma->vm_end, nodes);
start, endvma, nodes);
if (err) {
first = ERR_PTR(err);
break;