DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] net/i40e: fix integer overflow
@ 2019-10-14  8:33 Xiao Zhang
  2019-10-14 10:35 ` Kevin Traynor
  2019-10-15  5:29 ` [dpdk-dev] [v2] " Xiao Zhang
  0 siblings, 2 replies; 5+ messages in thread
From: Xiao Zhang @ 2019-10-14  8:33 UTC (permalink / raw)
  To: dev; +Cc: beilei.xing, qi.z.zhang, Xiao Zhang, stable

When configuring i40e rx queue, the temporary variable to store max packet
length is not big enough which leads to integer overflow issue. This
patch is to fix the issue by changing the variable type from uint16_t
to uint32_t.

Fixes: c511a96a34d7 ("mbuf: add accessors for data room and private
size")
Cc: stable@dpdk.org

Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
---
 drivers/net/i40e/i40e_rxtx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index bfe161f..ca15b12 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -2596,7 +2596,8 @@ i40e_rx_queue_config(struct i40e_rx_queue *rxq)
 	struct i40e_pf *pf = I40E_VSI_TO_PF(rxq->vsi);
 	struct i40e_hw *hw = I40E_VSI_TO_HW(rxq->vsi);
 	struct rte_eth_dev_data *data = pf->dev_data;
-	uint16_t buf_size, len;
+	uint16_t buf_size;
+	uint32_t len;
 
 	buf_size = (uint16_t)(rte_pktmbuf_data_room_size(rxq->mp) -
 		RTE_PKTMBUF_HEADROOM);
-- 
2.7.4


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-10-16  3:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-14  8:33 [dpdk-dev] net/i40e: fix integer overflow Xiao Zhang
2019-10-14 10:35 ` Kevin Traynor
2019-10-15  1:10   ` Zhang, Xiao
2019-10-15  5:29 ` [dpdk-dev] [v2] " Xiao Zhang
2019-10-16  3:21   ` Ye Xiaolong

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).