* [dpdk-dev] [PATCH 4/4] examples/tep_term: fix out-of-bounds access
@ 2016-06-30 7:35 Beilei Xing
0 siblings, 0 replies; only message in thread
From: Beilei Xing @ 2016-06-30 7:35 UTC (permalink / raw)
To: jingjing.wu, michalx.k.jastrzebski; +Cc: dev, Beilei Xing
Coverity reported lots of out-of-bounds in function
vxlan_link, these issues should happen when index
port_id evaluates to 2, cause size of arrays is
2 in structure.
Fix this issue by modifying judgement condition, make
sure port_id is less than 2.
Fixes: 4abe471ed6fc ("examples/tep_term: implement VXLAN processing")
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
---
examples/tep_termination/vxlan_setup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/examples/tep_termination/vxlan_setup.c b/examples/tep_termination/vxlan_setup.c
index 37575c2..8f1f15b 100644
--- a/examples/tep_termination/vxlan_setup.c
+++ b/examples/tep_termination/vxlan_setup.c
@@ -249,7 +249,7 @@ vxlan_link(struct vhost_dev *vdev, struct rte_mbuf *m)
struct rte_eth_tunnel_filter_conf tunnel_filter_conf;
- if (unlikely(portid > VXLAN_N_PORTS)) {
+ if (unlikely(portid >= VXLAN_N_PORTS)) {
RTE_LOG(INFO, VHOST_DATA,
"(%d) WARNING: Not configuring device,"
"as already have %d ports for VXLAN.",
--
2.5.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-06-30 7:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-30 7:35 [dpdk-dev] [PATCH 4/4] examples/tep_term: fix out-of-bounds access Beilei Xing
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).