* [PATCH] [for 2.6.13-stable] Fix MPOL_F_VERIFY
@ 2005-09-13 12:01 Andi Kleen
2005-09-13 16:56 ` Chris Wright
0 siblings, 1 reply; 2+ messages in thread
From: Andi Kleen @ 2005-09-13 12:01 UTC (permalink / raw)
To: stable; +Cc: linux-kernel
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>
Index: linux-2.6.13-work/mm/mempolicy.c
===================================================================
--- linux-2.6.13-work.orig/mm/mempolicy.c
+++ linux-2.6.13-work/mm/mempolicy.c
@@ -338,8 +338,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;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-09-13 16:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-13 12:01 [PATCH] [for 2.6.13-stable] Fix MPOL_F_VERIFY Andi Kleen
2005-09-13 16:56 ` Chris Wright
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.