Commit 5b952b3c authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds
Browse files


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: default avatar"Andi Kleen" <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 8d0986e2
...@@ -333,8 +333,13 @@ check_range(struct mm_struct *mm, unsigned long start, unsigned long end, ...@@ -333,8 +333,13 @@ check_range(struct mm_struct *mm, unsigned long start, unsigned long end,
if (prev && prev->vm_end < vma->vm_start) if (prev && prev->vm_end < vma->vm_start)
return ERR_PTR(-EFAULT); return ERR_PTR(-EFAULT);
if ((flags & MPOL_MF_STRICT) && !is_vm_hugetlb_page(vma)) { 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, err = check_pgd_range(vma->vm_mm,
vma->vm_start, vma->vm_end, nodes); start, endvma, nodes);
if (err) { if (err) {
first = ERR_PTR(err); first = ERR_PTR(err);
break; break;
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