From: "Andi Kleen" 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" Signed-off-by: Andrew Morton --- mm/mempolicy.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletion(-) diff -puN mm/mempolicy.c~fix-mpol_f_verify mm/mempolicy.c --- devel/mm/mempolicy.c~fix-mpol_f_verify 2005-09-10 14:30:23.000000000 -0700 +++ devel-akpm/mm/mempolicy.c 2005-09-10 14:33:02.000000000 -0700 @@ -333,8 +333,13 @@ check_range(struct mm_struct *mm, unsign 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; _