From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 511AFA04DB for ; Mon, 7 Sep 2020 04:13:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 36BEE1C0BE; Mon, 7 Sep 2020 04:13:53 +0200 (CEST) Received: from mail.chinasoftinc.com (unknown [114.113.233.8]) by dpdk.org (Postfix) with ESMTP id 5245529AC; Mon, 7 Sep 2020 04:13:48 +0200 (CEST) Received: from [192.168.1.199] (139.159.243.11) by INCCAS002.ito.icss (10.168.0.60) with Microsoft SMTP Server id 14.3.487.0; Mon, 7 Sep 2020 10:13:30 +0800 To: wangyunjian , CC: , , , , , References: From: "Wei Hu (Xavier)" Message-ID: <285fd50d-75bf-5009-cd39-cbd97485aa2d@chinasoftinc.com> Date: Mon, 7 Sep 2020 10:13:29 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Originating-IP: [139.159.243.11] Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] net/hns3: fix out-of-bounds access X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" On 2020/9/7 9:46, wangyunjian wrote: > From: Yunjian Wang > > This patch fixes (out-of-bounds access) coverity issue. > > Coverity issue: 349932 > Fixes: 7d7f9f80bbfb ("net/hns3: support MAC address related operations") > Cc: stable@dpdk.org > > Signed-off-by: Yunjian Wang Reviewed-by: Wei Hu (Xavier) > --- > drivers/net/hns3/hns3_ethdev.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c > index 81e773046..efe515221 100644 > --- a/drivers/net/hns3/hns3_ethdev.c > +++ b/drivers/net/hns3/hns3_ethdev.c > @@ -1401,7 +1401,7 @@ hns3_add_uc_addr_common(struct hns3_hw *hw, struct rte_ether_addr *mac_addr) > struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw); > struct hns3_mac_vlan_tbl_entry_cmd req; > struct hns3_pf *pf = &hns->pf; > - struct hns3_cmd_desc desc; > + struct hns3_cmd_desc desc[3]; > char mac_str[RTE_ETHER_ADDR_FMT_SIZE]; > uint16_t egress_port = 0; > uint8_t vf_id; > @@ -1435,7 +1435,7 @@ hns3_add_uc_addr_common(struct hns3_hw *hw, struct rte_ether_addr *mac_addr) > * it if the entry is inexistent. Repeated unicast entry > * is not allowed in the mac vlan table. > */ > - ret = hns3_lookup_mac_vlan_tbl(hw, &req, &desc, false); > + ret = hns3_lookup_mac_vlan_tbl(hw, &req, desc, false); > if (ret == -ENOENT) { > if (!hns3_is_umv_space_full(hw)) { > ret = hns3_add_mac_vlan_tbl(hw, &req, NULL);