From: Brian Dooley <brian.dooley@intel.com>
To: dev@dpdk.org
Cc: Brian Dooley <brian.dooley@intel.com>,
declan.doherty@intel.com, stable@dpdk.org,
Akhil Goyal <gakhil@marvell.com>,
Fan Zhang <roy.fan.zhang@intel.com>,
Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Subject: [PATCH] examples/l2fwd-crypto: fix potential overflow
Date: Mon, 21 Feb 2022 18:06:58 +0000 [thread overview]
Message-ID: <20220221180658.440683-1-brian.dooley@intel.com> (raw)
Coverity flags an issue with 32-bit value. If max ethports value is
configured with a value larger than 32 there will be an issue.
Coverity issue: 375863 Unintentional integer overflow
Fixes: 387259bd6c67 ("examples/l2fwd-crypto: add sample application")
Cc: declan.doherty@intel.com
Cc: stable@dpdk.org
Signed-off-by: Brian Dooley <brian.dooley@intel.com>
---
examples/l2fwd-crypto/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index 4d9f8861af..bbdb263143 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -2719,7 +2719,7 @@ initialize_ports(struct l2fwd_crypto_options *options)
last_portid = portid;
}
- l2fwd_enabled_port_mask |= (1 << portid);
+ l2fwd_enabled_port_mask |= (1ULL << portid);
enabled_portcount++;
}
--
2.25.1
next reply other threads:[~2022-02-21 18:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-21 18:06 Brian Dooley [this message]
2022-02-23 10:52 ` [EXT] " 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=20220221180658.440683-1-brian.dooley@intel.com \
--to=brian.dooley@intel.com \
--cc=declan.doherty@intel.com \
--cc=dev@dpdk.org \
--cc=gakhil@marvell.com \
--cc=roy.fan.zhang@intel.com \
--cc=sergio.gonzalez.monroy@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).