Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3464240imw; Mon, 18 Jul 2022 08:32:16 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uRRkBKYY1vL0tQhfvfB01PWHo9OkWEnvsx+mFlEGIs5qNE1AUu4yvWZfpsIXqSkhLCCoPH X-Received: by 2002:a17:906:2086:b0:715:7983:a277 with SMTP id 6-20020a170906208600b007157983a277mr26040423ejq.386.1658158335868; Mon, 18 Jul 2022 08:32:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658158335; cv=none; d=google.com; s=arc-20160816; b=LhYJ8skdeq1VhI6kh6RJVFUhydZDWtZxwrVI/Fk7KTjOPuti+jVYy6OPIayvyoifG4 VGbrareiLsWorWDb+1/XcxoBRhkqgQDVHzaWkrEM7nr43wHNP19Mj3LYGCVckXnUSHo/ eCkLzSH4kxNYHewUEiJbhDtpQf8hNF+GmwLwFA3cdCQ6EH/xRbG21DyxzTM4SM869GsX feCeBfEDxa680VNmscrvHpFI/hO5l3v2DBjiisD9wyYs+hvBp8h0KJtCtKvsQjDyJlcS 25ZZx57dct/sFdnhSSF6nQtk6yC13laEx9KcOut7ZYvW8/kqxUDEDA4ZQahNTEXQWgSX PnLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=Z3S539J8CIIVDTwSTMhVNAmznCkjA8tBufBAwKthkJM=; b=VftSxtsqjhv7IkoQMNj/+gtpXnzV4ShVvNCJA/VPB8gA/Fy6hBCx5hn4eJKzgP+Hbx MfzYB8RM7N9P+M4dJ4wokftJcamolchlwgeZXehqnDvIj31hqpEB9blKm3taBkp2sL9s WxRHTxsK8XaL8IA0OOrRJlmzyAm5dVJa0qDyMrTOxezcihlFKMjGgPBkKxhtZIFrKEtf RvmqRVvcBoZd39phDKi0gX9iZLp++AvTwl1iM8Tc3slpi7bucSMs9JyAhJurGGEikzaq XJ94LzUWINSXqB8rc3JQrOcQ64YadUMBZ1qez37ODC4utRmyAybfGKRhQ5xabtkT3TqG oQYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Iq0O5rre; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dm2-20020a170907948200b0072f4445483fsi1658682ejc.906.2022.07.18.08.31.50; Mon, 18 Jul 2022 08:32:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Iq0O5rre; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235547AbiGRP3R (ORCPT + 99 others); Mon, 18 Jul 2022 11:29:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235630AbiGRP3O (ORCPT ); Mon, 18 Jul 2022 11:29:14 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04E17BA9; Mon, 18 Jul 2022 08:29:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1658158155; x=1689694155; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=yH2iAt7Nak/S2cxw66iqqC0mytMna35OO1GjNSnHyFo=; b=Iq0O5rreNmIynoPU/qpnN2x9ipQ1aOY7v+5yFu3a2so0hpMXU4KzAN4X iCfMBOo1/V+XESlU6XHZ2Ji6pnQgfbllir5sbL89m7dlRgFlfMunko8kT JU7v1ME++muFOw0lIsKEaPX2A2bwozkExYcOIrokrA8NV01Vrvv+zJxOW 25IWSNTsnn8BHPADDVFzCraLIbGf359c+hLc7tnZtivvA87OZpj0m0mvr aaQBw59TSkcWAKeXCnuukiJD39czSD20mU7HjJdXicauGKIItWFD32hM6 7hvDe+dQMv/S4tt49UCs4RLJz0zrrsAYlWPLyeU2GTmLWStbgjX4lUDcL g==; X-IronPort-AV: E=McAfee;i="6400,9594,10412"; a="347938874" X-IronPort-AV: E=Sophos;i="5.92,281,1650956400"; d="scan'208";a="347938874" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jul 2022 08:29:15 -0700 X-IronPort-AV: E=Sophos;i="5.92,281,1650956400"; d="scan'208";a="572449344" Received: from jwconnol-mobl1.amr.corp.intel.com (HELO spandruv-desk1.amr.corp.intel.com) ([10.209.102.92]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jul 2022 08:29:13 -0700 Message-ID: <4d30ed8d43d0db93c5f550bb69931f288285aa2b.camel@linux.intel.com> Subject: Re: [PATCH] tools/power/x86/intel-speed-select: Fix off by one check From: srinivas pandruvada To: Dan Carpenter Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Date: Mon, 18 Jul 2022 08:29:13 -0700 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2022-07-18 at 16:17 +0300, Dan Carpenter wrote: > Change > MAX_DIE_PER_PACKAGE to >= MAX_DIE_PER_PACKAGE to prevent > accessing one element beyond the end of the array. > > Fixes: 7fd786dfbd2c ("tools/power/x86/intel-speed-select: OOB daemon > mode") > Signed-off-by: Dan Carpenter Thanks. I will add to PULL request. > --- >  tools/power/x86/intel-speed-select/isst-daemon.c | 2 +- >  1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/power/x86/intel-speed-select/isst-daemon.c > b/tools/power/x86/intel-speed-select/isst-daemon.c > index dd372924bc82..d0400c6684ba 100644 > --- a/tools/power/x86/intel-speed-select/isst-daemon.c > +++ b/tools/power/x86/intel-speed-select/isst-daemon.c > @@ -41,7 +41,7 @@ void process_level_change(int cpu) >         time_t tm; >         int ret; >   > -       if (pkg_id >= MAX_PACKAGE_COUNT || die_id > > MAX_DIE_PER_PACKAGE) { > +       if (pkg_id >= MAX_PACKAGE_COUNT || die_id >= > MAX_DIE_PER_PACKAGE) { >                 debug_printf("Invalid package/die info for cpu:%d\n", > cpu); >                 return; >         }