Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751125AbWCBERT (ORCPT ); Wed, 1 Mar 2006 23:17:19 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751139AbWCBERT (ORCPT ); Wed, 1 Mar 2006 23:17:19 -0500 Received: from mx1.redhat.com ([66.187.233.31]:17357 "EHLO mx1.redhat.com") by vger.kernel.org with ESMTP id S1751125AbWCBERS (ORCPT ); Wed, 1 Mar 2006 23:17:18 -0500 Date: Wed, 1 Mar 2006 23:10:31 -0500 From: Dave Jones To: Chris Wright Cc: linux-kernel@vger.kernel.org, stable@kernel.org, Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Chuck Wolber , torvalds@osdl.org, akpm@osdl.org, alan@lxorguk.ukuu.org.uk, Andi Kleen , Greg Kroah-Hartman Subject: Re: [patch 18/39] [PATCH] sys_mbind sanity checking Message-ID: <20060302041031.GF19755@redhat.com> Mail-Followup-To: Dave Jones , Chris Wright , linux-kernel@vger.kernel.org, stable@kernel.org, Justin Forbes , Zwane Mwaikambo , Theodore Ts'o , Randy Dunlap , Chuck Wolber , torvalds@osdl.org, akpm@osdl.org, alan@lxorguk.ukuu.org.uk, Andi Kleen , Greg Kroah-Hartman References: <20060227223200.865548000@sorel.sous-sol.org> <20060227223350.609924000@sorel.sous-sol.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060227223350.609924000@sorel.sous-sol.org> User-Agent: Mutt/1.4.2.1i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1950 Lines: 56 On Mon, Feb 27, 2006 at 02:32:18PM -0800, Chris Wright wrote: > -stable review patch. If anyone has any objections, please let us know. > ------------------ > > Make sure maxnodes is safe size before calculating nlongs in > get_nodes(). > > Signed-off-by: Chris Wright > Signed-off-by: Linus Torvalds > [chrisw: fix units, pointed out by Andi] > Cc: Andi Kleen > Signed-off-by: Greg Kroah-Hartman > --- > > mm/mempolicy.c | 2 ++ > 1 files changed, 2 insertions(+) > > --- linux-2.6.15.4.orig/mm/mempolicy.c > +++ linux-2.6.15.4/mm/mempolicy.c > @@ -524,6 +524,8 @@ static int get_nodes(nodemask_t *nodes, > nodes_clear(*nodes); > if (maxnode == 0 || !nmask) > return 0; > + if (maxnode > PAGE_SIZE*BITS_PER_BYTE) > + return -EINVAL; > > nlongs = BITS_TO_LONGS(maxnode); > if ((maxnode % BITS_PER_LONG) == 0) Gar.. mm/mempolicy.c: In function 'get_nodes': mm/mempolicy.c:527: error: 'BITS_PER_BYTE' undeclared (first use in this function) mm/mempolicy.c:527: error: (Each undeclared identifier is reported only once mm/mempolicy.c:527: error: for each function it appears in.) About to retry a build with the below patch which should do the trick. (How did this *ever* build?) Signed-off-by: Dave Jones --- linux-2.6.15/include/linux/types.h~ 2006-03-01 23:05:24.000000000 -0500 +++ linux-2.6.15/include/linux/types.h 2006-03-01 23:05:57.000000000 -0500 @@ -8,6 +8,7 @@ (((bits)+BITS_PER_LONG-1)/BITS_PER_LONG) #define DECLARE_BITMAP(name,bits) \ unsigned long name[BITS_TO_LONGS(bits)] +#define BITS_PER_BYTE 8 #endif #include - 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/