DPDK patches and discussions
 help / color / mirror / Atom feed
From: <psatheesh@marvell.com>
To: Radu Nicolau <radu.nicolau@intel.com>, Akhil Goyal <gakhil@marvell.com>
Cc: <dev@dpdk.org>, Satheesh Paul <psatheesh@marvell.com>, <stable@dpdk.org>
Subject: [dpdk-dev] [PATCH] examples/ipsec-secgw: fix flow pattern buffer overrun
Date: Wed, 3 Aug 2022 14:55:37 +0530	[thread overview]
Message-ID: <20220803092537.2205277-1-psatheesh@marvell.com> (raw)

From: Satheesh Paul <psatheesh@marvell.com>

This patch fixes the patterns buffer overrun issue reported
by Coverity.

Coverity issue: 379236
Fixes: 8d0cdaa2d7 ("examples/ipsec-secgw: support mark and security flow action")
Cc: stable@dpdk.org

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Reviewed-by: Akhil Goyal <gakhil@marvell.com>
---
 examples/ipsec-secgw/flow.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/examples/ipsec-secgw/flow.c b/examples/ipsec-secgw/flow.c
index aee97b2fc4..9b18be83af 100644
--- a/examples/ipsec-secgw/flow.c
+++ b/examples/ipsec-secgw/flow.c
@@ -270,7 +270,7 @@ parse_flow_tokens(char **tokens, uint32_t n_tokens,
 	nb_flow_rule++;
 }
 
-#define MAX_RTE_FLOW_PATTERN (4)
+#define MAX_RTE_FLOW_PATTERN (5)
 #define MAX_RTE_FLOW_ACTIONS (5)
 
 static void
@@ -334,9 +334,7 @@ flow_init_single(struct flow_rule_entry *rule)
 		pattern[pattern_idx].spec = &rule->ipv4.spec;
 		pattern[pattern_idx].mask = &rule->ipv4.mask;
 		pattern_idx++;
-	}
-
-	if (rule->is_ipv6) {
+	} else if (rule->is_ipv6) {
 		pattern[pattern_idx].type = RTE_FLOW_ITEM_TYPE_IPV6;
 		pattern[pattern_idx].spec = &rule->ipv6.spec;
 		pattern[pattern_idx].mask = &rule->ipv6.mask;
-- 
2.35.3


             reply	other threads:[~2022-08-03  9:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-03  9:25 psatheesh [this message]
2022-08-28  8:47 ` Akhil Goyal

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=20220803092537.2205277-1-psatheesh@marvell.com \
    --to=psatheesh@marvell.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=radu.nicolau@intel.com \
    --cc=stable@dpdk.org \
    /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).