patches for DPDK stable branches
 help / color / Atom feed
* [dpdk-stable] [dpdk-dev] [PATCH] net/hns3: fix out-of-bounds access
@ 2020-09-07  1:46 wangyunjian
  2020-09-07  2:13 ` Wei Hu (Xavier)
  0 siblings, 1 reply; 3+ messages in thread
From: wangyunjian @ 2020-09-07  1:46 UTC (permalink / raw)
  To: dev
  Cc: xavier.huwei, humin29, yisen.zhuang, jerry.lilijun, xudingke,
	Yunjian Wang, stable

From: Yunjian Wang <wangyunjian@huawei.com>

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 <wangyunjian@huawei.com>
---
 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);
-- 
2.18.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH] net/hns3: fix out-of-bounds access
  2020-09-07  1:46 [dpdk-stable] [dpdk-dev] [PATCH] net/hns3: fix out-of-bounds access wangyunjian
@ 2020-09-07  2:13 ` Wei Hu (Xavier)
  2020-09-08  9:43   ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Hu (Xavier) @ 2020-09-07  2:13 UTC (permalink / raw)
  To: wangyunjian, dev
  Cc: xavier.huwei, humin29, yisen.zhuang, jerry.lilijun, xudingke, stable


On 2020/9/7 9:46, wangyunjian wrote:
> From: Yunjian Wang <wangyunjian@huawei.com>
>
> 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 <wangyunjian@huawei.com>
Reviewed-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>

> ---
>   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);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH] net/hns3: fix out-of-bounds access
  2020-09-07  2:13 ` Wei Hu (Xavier)
@ 2020-09-08  9:43   ` Ferruh Yigit
  0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2020-09-08  9:43 UTC (permalink / raw)
  To: Wei Hu (Xavier), wangyunjian, dev
  Cc: xavier.huwei, humin29, yisen.zhuang, jerry.lilijun, xudingke, stable

On 9/7/2020 3:13 AM, Wei Hu (Xavier) wrote:
> 
> On 2020/9/7 9:46, wangyunjian wrote:
>> From: Yunjian Wang <wangyunjian@huawei.com>
>>
>> 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 <wangyunjian@huawei.com>
> Reviewed-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
> 

Applied to dpdk-next-net/main, thanks.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-07  1:46 [dpdk-stable] [dpdk-dev] [PATCH] net/hns3: fix out-of-bounds access wangyunjian
2020-09-07  2:13 ` Wei Hu (Xavier)
2020-09-08  9:43   ` Ferruh Yigit

patches for DPDK stable branches

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/ public-inbox