From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763787AbXKTSeR (ORCPT ); Tue, 20 Nov 2007 13:34:17 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1761735AbXKTS1J (ORCPT ); Tue, 20 Nov 2007 13:27:09 -0500 Received: from pentafluge.infradead.org ([213.146.154.40]:51959 "EHLO pentafluge.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760578AbXKTS1I (ORCPT ); Tue, 20 Nov 2007 13:27:08 -0500 Date: Tue, 20 Nov 2007 10:24:35 -0800 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , Chuck Ebbert , Domenico Andreoli , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Andrew Hastings , Andi Kleen , Ingo Molnar , Thomas Gleixner Subject: [patch 19/29] x86: fix off-by-one in find_next_zero_string Message-ID: <20071120182435.GU28611@kroah.com> References: <20071120181733.702234406@mini.kroah.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="x86-fix-one-off-in-find-next-zero-string.patch" In-Reply-To: <20071120182248.GA28611@kroah.com> User-Agent: Mutt/1.5.16 (2007-06-09) X-Bad-Reply: References and In-Reply-To but no 'Re:' in Subject. Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org 2.6.23-stable review patch. If anyone has any objections, please let us know. ------------------ From: Andrew Hastings patch 801916c1b369b637ce799e6c71a94963ff63df79 in mainline. x86: fix off-by-one in find_next_zero_string Fix an off-by-one error in find_next_zero_string which prevents allocating the last bit. [ tglx: arch/x86 adaptation ] Signed-off-by: Andrew Hastings Signed-off-by: Andi Kleen Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner Signed-off-by: Greg Kroah-Hartman --- arch/x86_64/lib/bitstr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/x86_64/lib/bitstr.c +++ b/arch/x86_64/lib/bitstr.c @@ -14,7 +14,7 @@ find_next_zero_string(unsigned long *bit /* could test bitsliced, but it's hardly worth it */ end = n+len; - if (end >= nbits) + if (end > nbits) return -1; for (i = n+1; i < end; i++) { if (test_bit(i, bitmap)) { --