From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348577AbiFJKZ1 (ORCPT ); Fri, 10 Jun 2022 06:25:27 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62FDD41995 for ; Fri, 10 Jun 2022 03:25:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : content-type : in-reply-to : mime-version; s=corp-2021-07-09; bh=bLrVRACKBclyDrgtatDSMrKKiXvc6+eZ2GQSjFqnZaU=; b=nrZESARCMOuRd1lY4uQAi5LnzBVvzVpSHvlcdz0e95xg5+YERBP/y0FKb4+hf073rM80 ua/y+5UUvuQTC/cG/2MeEHx7u0BWVx4V5MyuS9X48L/hgcmfNbEdkOK47dMUmYZuu5H+ QivavGHw2jeRHoMJW+aUzIxU/xR1r+I9GZpo9a3sXWR6slT7N+NtzPV48bLSaL6ZfHi7 MzsQl9OtUoQXBhnuWokg1Iok0+onVkzo+LaaDP6eZVnpcIFgWkkYzXpOY+pxPpalsfHI hdsPDKDWVI7vPnXOYc412dThCWxfReAXMv3Z0SjkFSO94R8b/e5TAI3t3MmNlaQPTVw2 IQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bLrVRACKBclyDrgtatDSMrKKiXvc6+eZ2GQSjFqnZaU=; b=Og4PK+kwwDRQqkQaHjDQQPpG0xXMUWy0aGErJhFrg2rSvZ15bvr9a5DMnixf6VhpTtBe/nXRUvj6EQ9fahfPhiUrI0Spn7UPe71+5mCGkwwPzHAwVh+2DWL39iOCgxmFd3YJAR6ST0UHp+QqTFc5iRDtiXbP0pu7uC8Q4iG4S2g= Date: Fri, 10 Jun 2022 13:25:03 +0300 From: Dan Carpenter Subject: Re: [PATCH] check_ida_alloc: Add a new check to spot invalid conversion from ida_simple_get() Message-ID: <20220610102503.GC2146@kadam> References: <0a738352f2bc12e9bce553e03fdec48ffb237899.1654806710.git.christophe.jaillet@wanadoo.fr> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0a738352f2bc12e9bce553e03fdec48ffb237899.1654806710.git.christophe.jaillet@wanadoo.fr> MIME-Version: 1.0 List-ID: To: Christophe JAILLET Cc: smatch@vger.kernel.org On Thu, Jun 09, 2022 at 10:33:40PM +0200, Christophe JAILLET wrote: > The 'max' parameter of ida_alloc_max() and ida_alloc_range() is not > interpreted as it was in the deprecated ida_simple_get(). > > The 'max' value in the new functions is inclusive but it was exclusive > before. So, in older code, this parameter was often a power of 2, such as > 1 << 16, so that the maximum possible value was 0xffff. > > Now a power of 2 value is spurious. > > Signed-off-by: Christophe JAILLET > --- > Most of the code is stolen from smatch_power_of_two.c > --- Thanks, applied! regards, dan carpenter