From eb41bf795f3d5be665a0d52ae568d7df7fa8341c Mon Sep 17 00:00:00 2001 From: Kuba Kozak Date: Tue, 25 Jul 2017 14:19:25 +0200 Subject: [PATCH] net/igb: fix access bound in ethertype filter Fix wrong structure type used as argument in memset() call. Coverity issue: 147223 Coverity issue: 147227 Fixes: a8600af43738 ("net/igb: parse flow API ethertype filter") Fixes: 22bb13410cb2 ("net/igb: create consistent filter") Cc: stable@dpdk.org Signed-off-by: Kuba Kozak Acked-by: Wenzhuo Lu --- drivers/net/e1000/igb_flow.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/e1000/igb_flow.c b/drivers/net/e1000/igb_flow.c index db73b181ae..ed2ecc40ce 100644 --- a/drivers/net/e1000/igb_flow.c +++ b/drivers/net/e1000/igb_flow.c @@ -694,7 +694,8 @@ igb_parse_ethertype_filter(struct rte_eth_dev *dev, if (hw->mac.type == e1000_82576) { if (filter->queue >= IGB_MAX_RX_QUEUE_NUM_82576) { - memset(filter, 0, sizeof(struct rte_eth_ntuple_filter)); + memset(filter, 0, sizeof( + struct rte_eth_ethertype_filter)); rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, NULL, "queue number not supported " @@ -703,7 +704,8 @@ igb_parse_ethertype_filter(struct rte_eth_dev *dev, } } else { if (filter->queue >= IGB_MAX_RX_QUEUE_NUM) { - memset(filter, 0, sizeof(struct rte_eth_ntuple_filter)); + memset(filter, 0, sizeof( + struct rte_eth_ethertype_filter)); rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, NULL, "queue number not supported " -- 2.20.1