patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [dpdk-dev] [PATCH] net/hinic: fix negative array index read
@ 2020-08-24 12:43 wangyunjian
  2020-08-24 12:54 ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: wangyunjian @ 2020-08-24 12:43 UTC (permalink / raw)
  To: dev
  Cc: cloud.wangxiaoyun, zhouguoyang, xuanziyang2, jerry.lilijun,
	xudingke, Yunjian Wang, stable

From: Yunjian Wang <wangyunjian@huawei.com>

Negative array index read using variable 'i' as an index to array
'filter_info->pkt_filters'. Fixed by add return value check.

Coverity issue: 350364
Fixes: f4ca3fd54c4d ("net/hinic: create and destroy flow director filter")
Cc: stable@dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
---
 drivers/net/hinic/hinic_pmd_flow.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/hinic/hinic_pmd_flow.c b/drivers/net/hinic/hinic_pmd_flow.c
index 503a32fff..70fd4450c 100644
--- a/drivers/net/hinic/hinic_pmd_flow.c
+++ b/drivers/net/hinic/hinic_pmd_flow.c
@@ -2351,6 +2351,8 @@ hinic_add_del_ethertype_filter(struct rte_eth_dev *dev,
 		ethertype_filter.pkt_proto = filter->ether_type;
 		i = hinic_ethertype_filter_lookup(filter_info,
 						&ethertype_filter);
+		if (i < 0)
+			return -EINVAL;
 
 		if ((filter_info->type_mask & (1 << i))) {
 			filter_info->pkt_filters[i].enable = FALSE;
-- 
2.23.0



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

* Re: [dpdk-stable] [dpdk-dev] [PATCH] net/hinic: fix negative array index read
  2020-08-24 12:43 [dpdk-stable] [dpdk-dev] [PATCH] net/hinic: fix negative array index read wangyunjian
@ 2020-08-24 12:54 ` Ferruh Yigit
  2020-08-25  9:15   ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Ferruh Yigit @ 2020-08-24 12:54 UTC (permalink / raw)
  To: wangyunjian, dev
  Cc: cloud.wangxiaoyun, zhouguoyang, xuanziyang2, jerry.lilijun,
	xudingke, stable

On 8/24/2020 1:43 PM, wangyunjian wrote:
> From: Yunjian Wang <wangyunjian@huawei.com>
> 
> Negative array index read using variable 'i' as an index to array
> 'filter_info->pkt_filters'. Fixed by add return value check.
> 
> Coverity issue: 350364
> Fixes: f4ca3fd54c4d ("net/hinic: create and destroy flow director filter")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

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

* Re: [dpdk-stable] [dpdk-dev] [PATCH] net/hinic: fix negative array index read
  2020-08-24 12:54 ` Ferruh Yigit
@ 2020-08-25  9:15   ` Ferruh Yigit
  0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2020-08-25  9:15 UTC (permalink / raw)
  To: wangyunjian, dev
  Cc: cloud.wangxiaoyun, zhouguoyang, xuanziyang2, jerry.lilijun,
	xudingke, stable

On 8/24/2020 1:54 PM, Ferruh Yigit wrote:
> On 8/24/2020 1:43 PM, wangyunjian wrote:
>> From: Yunjian Wang <wangyunjian@huawei.com>
>>
>> Negative array index read using variable 'i' as an index to array
>> 'filter_info->pkt_filters'. Fixed by add return value check.
>>
>> Coverity issue: 350364
>> Fixes: f4ca3fd54c4d ("net/hinic: create and destroy flow director filter")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> 
> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
> 

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

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

end of thread, other threads:[~2020-08-25  9:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-24 12:43 [dpdk-stable] [dpdk-dev] [PATCH] net/hinic: fix negative array index read wangyunjian
2020-08-24 12:54 ` Ferruh Yigit
2020-08-25  9:15   ` Ferruh Yigit

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://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/ https://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


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