From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 44690A0C42; Wed, 12 May 2021 09:03:51 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 309C8410DE; Wed, 12 May 2021 09:03:51 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 660614003E for ; Wed, 12 May 2021 09:03:49 +0200 (CEST) IronPort-SDR: lHOQEA1ZXjGvdshBa2mOuRE8n3/pW+4HQU5wpmPPAwORv8aLKHCquyvQuRvZ9LbcRGYAnWnYCU BqZn8patj4pQ== X-IronPort-AV: E=McAfee;i="6200,9189,9981"; a="260888709" X-IronPort-AV: E=Sophos;i="5.82,293,1613462400"; d="scan'208";a="260888709" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2021 00:03:48 -0700 IronPort-SDR: Ik2OvDXHsfgZhu4WeSDPaJ3oZuFszI2X5Ht76cU0pvlGpwOpHoqcx58tk9TjVFmdkaB8EBOCw9 I2p4sAfkXSng== X-IronPort-AV: E=Sophos;i="5.82,293,1613462400"; d="scan'208";a="622182430" Received: from dhunt5-mobl5.ger.corp.intel.com (HELO [10.252.17.89]) ([10.252.17.89]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2021 00:03:47 -0700 To: "Min Hu (Connor)" , dev@dpdk.org Cc: ferruh.yigit@intel.com References: <1619355594-15223-1-git-send-email-humin29@huawei.com> <1620785959-61903-1-git-send-email-humin29@huawei.com> From: David Hunt Message-ID: Date: Wed, 12 May 2021 08:03:44 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <1620785959-61903-1-git-send-email-humin29@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB Subject: Re: [dpdk-dev] [PATCH v2] lib/librte_power: fix using variables before validity check X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 12/5/2021 3:19 AM, Min Hu (Connor) wrote: > From: HongBo Zheng > > In function power_guest_channel_read_msg, 'lcore_id' is used before > validity check, which may cause buffer 'global_fds' accessed by index > 'lcore_id' overflow. > > This patch moves the validity check of 'lcore_id' before the 'lcore_id' > being used for the first time. > > Fixes: 9dc843eb273b ("power: extend guest channel API for reading") > Cc: stable@dpdk.org > > Signed-off-by: HongBo Zheng > Signed-off-by: Min Hu (Connor) > --- > v2: > * "global_fds[lcore_id]" check may move before the line > "fds.fd = global_fds[lcore_id]. Hi Connor, Just for future reference, it is common to include tags from previous version of a patch set unless there's major changes. So it would have been good to include Reshma's "Reviewed-by" tag in v2. Acked-by: David Hunt