DPDK patches and discussions
 help / color / mirror / Atom feed
From: Kuba Kozak <kubax.kozak@intel.com>
To: wenzhuo.lu@intel.com
Cc: dev@dpdk.org, deepak.k.jain@intel.com,
	michalx.k.jastrzebski@intel.com,
	Kuba Kozak <kubax.kozak@intel.com>,
	stable@dpdk.org
Subject: [dpdk-dev] [PATCH] net/e1000: fix out of bounds access
Date: Tue, 25 Jul 2017 14:19:25 +0200	[thread overview]
Message-ID: <1500985165-149859-1-git-send-email-kubax.kozak@intel.com> (raw)

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 <kubax.kozak@intel.com>
---
 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 db73b18..ed2ecc4 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.7.4

             reply	other threads:[~2017-07-25 12:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-25 12:19 Kuba Kozak [this message]
2017-07-25 13:24 ` Lu, Wenzhuo
2017-07-25 13:35   ` Jastrzebski, MichalX K
2017-07-25 14:04     ` Lu, Wenzhuo
2017-07-31 12:06   ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1500985165-149859-1-git-send-email-kubax.kozak@intel.com \
    --to=kubax.kozak@intel.com \
    --cc=deepak.k.jain@intel.com \
    --cc=dev@dpdk.org \
    --cc=michalx.k.jastrzebski@intel.com \
    --cc=stable@dpdk.org \
    --cc=wenzhuo.lu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).