Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2005-09-13 14:01:08 +0200
committerChris Wright <chrisw@osdl.org>2005-09-16 18:01:58 -0700
commit9c053068c7b8158850d680d8c96f3f11f5804367 (patch)
treef9ff24f8f82d168e849bd7131ba21d59e4d707f3
parent81ddd439761f2f2e6837f9746c83864f410a4077 (diff)
[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: Chris Wright <chrisw@osdl.org>
-rw-r--r--mm/mempolicy.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index b4eababc8198..54b522c7b015 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -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;