[dpdk-dev] [PATCH 3/3] net/sfc/base: fix out of bounds read in VIs allocation

Andrew Rybchenko arybchenko at solarflare.com
Tue Apr 4 14:13:27 CEST 2017


From: Andy Moreton <amoreton at solarflare.com>

Coverity issue: 1349662
Fixes: e7cd430c864f ("net/sfc/base: import SFN7xxx family support")
Cc: stable at dpdk.org

Signed-off-by: Andy Moreton <amoreton at solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko at solarflare.com>
---
 drivers/net/sfc/base/ef10_nic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/sfc/base/ef10_nic.c b/drivers/net/sfc/base/ef10_nic.c
index 3a74320..aac2679 100644
--- a/drivers/net/sfc/base/ef10_nic.c
+++ b/drivers/net/sfc/base/ef10_nic.c
@@ -501,7 +501,7 @@ efx_mcdi_alloc_vis(
 {
 	efx_mcdi_req_t req;
 	uint8_t payload[MAX(MC_CMD_ALLOC_VIS_IN_LEN,
-			    MC_CMD_ALLOC_VIS_OUT_LEN)];
+			    MC_CMD_ALLOC_VIS_EXT_OUT_LEN)];
 	efx_rc_t rc;
 
 	if (vi_countp == NULL) {
@@ -514,7 +514,7 @@ efx_mcdi_alloc_vis(
 	req.emr_in_buf = payload;
 	req.emr_in_length = MC_CMD_ALLOC_VIS_IN_LEN;
 	req.emr_out_buf = payload;
-	req.emr_out_length = MC_CMD_ALLOC_VIS_OUT_LEN;
+	req.emr_out_length = MC_CMD_ALLOC_VIS_EXT_OUT_LEN;
 
 	MCDI_IN_SET_DWORD(req, ALLOC_VIS_IN_MIN_VI_COUNT, min_vi_count);
 	MCDI_IN_SET_DWORD(req, ALLOC_VIS_IN_MAX_VI_COUNT, max_vi_count);
-- 
2.7.4



More information about the dev mailing list