Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030310AbVIOBE5 (ORCPT ); Wed, 14 Sep 2005 21:04:57 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1030307AbVIOBEw (ORCPT ); Wed, 14 Sep 2005 21:04:52 -0400 Received: from smtp.osdl.org ([65.172.181.4]:27329 "EHLO smtp.osdl.org") by vger.kernel.org with ESMTP id S1030308AbVIOBEm (ORCPT ); Wed, 14 Sep 2005 21:04:42 -0400 Message-Id: <20050915010410.499747000@localhost.localdomain> References: <20050915010343.577985000@localhost.localdomain> Date: Wed, 14 Sep 2005 18:03:52 -0700 From: Chris Wright To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Chuck Wolber , torvalds@osdl.org, akpm@osdl.org, alan@lxorguk.ukuu.org.uk, Andi Kleen , Chris Wright Subject: [PATCH 09/11] [PATCH] Fix MPOL_F_VERIFY Content-Disposition: inline; filename=fix-MPOL_F_VERIFY.patch Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1415 Lines: 41 -stable review patch. If anyone has any objections, please let us know. ------------------ 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: Chris Wright --- 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; -- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/