Skip to contentSkip to conversation

examples/tep_term: fix out-of-bounds access

PATCH Applied Beilei Xing 2 participants 2 messages Jul 5, 2016 – Jul 11, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 examples/tep_term: fix out-of-bounds access

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.

Coverity issue: 107121, 107122, 107123, 107124, 107125

Fixes 4abe471ed6fc ("examples/tep_term: implement VXLAN processing")
---
 examples/tep_termination/vxlan_setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
examples/tep_termination/vxlan_setup.c +1 -1
index 37575c2..8f1f15b 100644
@@ -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.",
Signature · 1 line
2.5.0
#1 lore raw

2016-07-05 14:15, Beilei Xing:

Quoted 7 lines

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.

Quoted 5 lines

Coverity issue: 107121, 107122, 107123, 107124, 107125

Fixes 4abe471ed6fc ("examples/tep_term: implement VXLAN processing")

Applied, thanks