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 E0DFFA0C42; Wed, 12 May 2021 09:14:10 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 664BF410DE; Wed, 12 May 2021 09:14:10 +0200 (CEST) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id 4F89E4003E for ; Wed, 12 May 2021 09:14:09 +0200 (CEST) Received: from dggeme756-chm.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Fg5Wv2Z8dzWfG9 for ; Wed, 12 May 2021 15:09:47 +0800 (CST) Received: from [10.67.103.128] (10.67.103.128) by dggeme756-chm.china.huawei.com (10.3.19.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Wed, 12 May 2021 15:14:02 +0800 To: David Hunt , CC: References: <1619355594-15223-1-git-send-email-humin29@huawei.com> <1620785959-61903-1-git-send-email-humin29@huawei.com> From: "Min Hu (Connor)" Message-ID: Date: Wed, 12 May 2021 15:14:02 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.128] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggeme756-chm.china.huawei.com (10.3.19.102) X-CFilter-Loop: Reflected 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" 在 2021/5/12 15:03, David Hunt 写道: > > 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 Thanks David, got it. > > > > .