Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759113AbZJMJLI (ORCPT ); Tue, 13 Oct 2009 05:11:08 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753454AbZJMJLI (ORCPT ); Tue, 13 Oct 2009 05:11:08 -0400 Received: from mail-vw0-f203.google.com ([209.85.212.203]:62006 "EHLO mail-vw0-f203.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751006AbZJMJLF (ORCPT ); Tue, 13 Oct 2009 05:11:05 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=rJo7LePeCp2nV0T7hKIjmhsSIFvv9g6bkDd7jdduN3RMTcSnjLEeRVXQExvu9SMwuL 4f97eyHog+2O0e291WpWWrRFCalaA886MUMntxvZn84zxJLhUOtUtQFiOcwn3mqPy2tW t8U6FKZajXyeWpnO2lBGu4otxLvAH15kdMU+U= Date: Tue, 13 Oct 2009 18:10:17 +0900 From: Akinobu Mita To: Andrew Morton Cc: linux-kernel@vger.kernel.org, FUJITA Tomonori , "David S. Miller" , sparclinux@vger.kernel.org, Benjamin Herrenschmidt , Paul Mackerras , linuxppc-dev@ozlabs.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Greg Kroah-Hartman , Lothar Wassmann , linux-usb@vger.kernel.org, Roland Dreier , Yevgeny Petrilin , netdev@vger.kernel.org, Tony Luck , Fenghua Yu , linux-ia64@vger.kernel.org, linux-altix@sgi.com Subject: Re: [PATCH 2/8] bitmap: Introduce bitmap_set, bitmap_clear, bitmap_find_next_zero_area Message-ID: <20091013091017.GA18431@localhost.localdomain> References: <1255076961-21325-1-git-send-email-akinobu.mita@gmail.com> <1255076961-21325-2-git-send-email-akinobu.mita@gmail.com> <20091009164100.85a36188.akpm@linux-foundation.org> <20091013021818.GA3898@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091013021818.GA3898@localhost.localdomain> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 925 Lines: 31 My user space testing exposed off-by-one error find_next_zero_area in iommu-helper. Some zero area cannot be found by this bug. Subject: [PATCH] Fix off-by-one error in find_next_zero_area Signed-off-by: Akinobu Mita --- lib/iommu-helper.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lib/iommu-helper.c b/lib/iommu-helper.c index 75dbda0..afc58bc 100644 --- a/lib/iommu-helper.c +++ b/lib/iommu-helper.c @@ -19,7 +19,7 @@ again: index = (index + align_mask) & ~align_mask; end = index + nr; - if (end >= size) + if (end > size) return -1; for (i = index; i < end; i++) { if (test_bit(i, map)) { -- 1.5.4.3 -- 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/