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 0EC98A0A0E; Wed, 12 May 2021 17:19:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 81B98410DB; Wed, 12 May 2021 17:19:22 +0200 (CEST) Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by mails.dpdk.org (Postfix) with ESMTP id CB1E74003E for ; Wed, 12 May 2021 17:19:20 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 9F65C1363; Wed, 12 May 2021 11:19:19 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 12 May 2021 11:19:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm1; bh= AWHvzumnb0VX3vpMEB3+LSEh/90shBXlpmQ2olSRcfc=; b=qz+Y6o9ccxeM1aUr Tf+DZun1tzbTFRN7/MekElE1e9SHv/ecB7ro/UBluktdZeX7NpWxdHReD+YRbhyU 1UsJ4XrFpoKVVhLSm0NaNzNroVFtSnnD5PiTHq86pvaZeEiJKsiifh6CE3tfOHFR CDLOjsqnizo3LdPbKxsHJM/+XJremCiKbmBe6c0AZDA5gY/54sO6odYyHb6PWCwq WlyVAXy9uP8q9JQ++tZE9h+UjUQ/L4KIs8aq+y6XuRuRaXRLrR2NQwcfIZjUcyXP Z4dNJn8l1rSsiq9HF1f5ghii2rknkfVoTeIGIffenRLF9fP7YdUd21Fzkmu+6AOg zgXJGg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=AWHvzumnb0VX3vpMEB3+LSEh/90shBXlpmQ2olSRc fc=; b=VvRlLWa8tyQgWetRH9tZy5b8W6btiSt6Kg9oi8YMRcp5RMqaE68uJHzgq UcKtyaFlwK+tl8DaDmwRo1cKCj4P3/Opgz90MhVOBL2S3RHT26sVv3OvMaePCMI9 ijUP+Ll04iZ+MtdL/Y1NQKm+LYAVfbQVlr9Ibb9LExfoG932g+26YRRlgrWK4wlQ jeF3AbEKWQu6rbAagh/FRk1CvjnF4sBQ0rByYCG6cUF4nES+MsuUWvgQakqicup4 YxnBZGdOJSG3Wt/qjk2gVIRyQ7cJObrTokAscvKRxsHq97vA4AS2hsx7ssZeEiLZ IC9OE8KUOSdL6PJ7lEAkE4Xv5SP6g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdehvddgkeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu ieeivdffgeehnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl ohhnrdhnvght X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 12 May 2021 11:19:17 -0400 (EDT) From: Thomas Monjalon To: "Min Hu (Connor)" Cc: dev@dpdk.org, ferruh.yigit@intel.com, David Hunt , reshma.pattan@intel.com Date: Wed, 12 May 2021 17:19:16 +0200 Message-ID: <1895782.HPLxxfrSh9@thomas> In-Reply-To: References: <1619355594-15223-1-git-send-email-humin29@huawei.com> <1620785959-61903-1-git-send-email-humin29@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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" > > 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 Applied with Reshma's tag, thanks. title: power: fix sanity checks for guest channel read