]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Add fix for MPOL_F_VERIFY from Andi.
authorChris Wright <chrisw@osdl.org>
Tue, 13 Sep 2005 16:56:37 +0000 (09:56 -0700)
committerChris Wright <chrisw@osdl.org>
Tue, 13 Sep 2005 16:56:37 +0000 (09:56 -0700)
queue/fix-MPOL_F_VERIFY.patch [new file with mode: 0644]
queue/series

diff --git a/queue/fix-MPOL_F_VERIFY.patch b/queue/fix-MPOL_F_VERIFY.patch
new file mode 100644 (file)
index 0000000..5031a0e
--- /dev/null
@@ -0,0 +1,38 @@
+From stable-bounces@linux.kernel.org  Tue Sep 13 05:01:26 2005
+From: Andi Kleen <ak@suse.de>
+To: stable@kernel.org
+Date: Tue, 13 Sep 2005 14:01:08 +0200
+Cc: linux-kernel@vger.kernel.org
+Subject: [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>
+---
+ mm/mempolicy.c |    7 ++++++-
+ 1 files changed, 6 insertions(+), 1 deletion(-)
+
+Index: linux-2.6.13.y/mm/mempolicy.c
+===================================================================
+--- linux-2.6.13.y.orig/mm/mempolicy.c
++++ linux-2.6.13.y/mm/mempolicy.c
+@@ -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;
index 130574a4970ede82e24d1adc8930dcfc1fccdd63..0adf432514bd66fb6f2a6de46aa3d63e61b43c79 100644 (file)
@@ -4,3 +4,4 @@ sungem-enable-and-map-pci-rom-properly.patch
 sunhme-enable-and-map-pci-rom-properly.patch
 netfilter-fix-dhcp-masquerade-problem.patch
 jfs_delete_inode-must-call-clear_inode.patch
+fix-MPOL_F_VERIFY.patch