Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756346Ab2BMKM0 (ORCPT ); Mon, 13 Feb 2012 05:12:26 -0500 Received: from mail-pz0-f46.google.com ([209.85.210.46]:47783 "EHLO mail-pz0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751302Ab2BMKMY (ORCPT ); Mon, 13 Feb 2012 05:12:24 -0500 Date: Mon, 13 Feb 2012 02:12:21 -0800 (PST) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Dan Smith cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Ensure that walk_page_range()'s start and end are page-aligned In-Reply-To: <1328902796-30389-1-git-send-email-danms@us.ibm.com> Message-ID: References: <1328902796-30389-1-git-send-email-danms@us.ibm.com> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 929 Lines: 21 On Fri, 10 Feb 2012, Dan Smith wrote: > The inner function walk_pte_range() increments "addr" by PAGE_SIZE after > each pte is processed, and only exits the loop if the result is equal to > "end". Current, if either (or both of) the starting or ending addresses > passed to walk_page_range() are not page-aligned, then we will never > satisfy that exit condition and begin calling the pte_entry handler with > bad data. > > To be sure that we will land in the right spot, this patch checks that > both "addr" and "end" are page-aligned in walk_page_range() before starting > the traversal. > It doesn't "ensure" anything without CONFIG_DEBUG_VM enabled, which isn't the default. -- 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/