[dpdk-stable] patch 'vfio: fix array bounds check' has been queued to stable release 17.05.1

Yuanhan Liu yliu at fridaylinux.org
Tue Jun 20 13:35:16 CEST 2017


Hi,

FYI, your patch has been queued to stable release 17.05.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/22/17. So please
shout if anyone has objections.

Thanks.

	--yliu

---
>From 7b6546c7fd42c24a569ffdc4dfc7fe5b7d706a11 Mon Sep 17 00:00:00 2001
From: Alejandro Lucero <alejandro.lucero at netronome.com>
Date: Fri, 12 May 2017 11:18:25 +0100
Subject: [PATCH] vfio: fix array bounds check

[ upstream commit 4af00fb1a2449f23a7c0fc32159207ae68b0fbbb ]

Checking against VFIO_MAX_GROUPS goes beyond the maximum array
index which should be (VFIO_MAX_GROUPS - 1).

Coverity issue: 144555, 144556, 144557
Fixes: 94c0776b1bad ("support hotplug")

Signed-off-by: Alejandro Lucero <alejandro.lucero at netronome.com>
Acked-by: Anatoly Burakov <anatoly.burakov at intel.com>
---
 lib/librte_eal/linuxapp/eal/eal_vfio.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c
index 53ac725..946df7e 100644
--- a/lib/librte_eal/linuxapp/eal/eal_vfio.c
+++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c
@@ -189,7 +189,7 @@ vfio_group_device_get(int vfio_group_fd)
 	int i;
 
 	i = get_vfio_group_idx(vfio_group_fd);
-	if (i < 0 || i > VFIO_MAX_GROUPS)
+	if (i < 0 || i > (VFIO_MAX_GROUPS - 1))
 		RTE_LOG(ERR, EAL, "  wrong vfio_group index (%d)\n", i);
 	else
 		vfio_cfg.vfio_groups[i].devices++;
@@ -201,7 +201,7 @@ vfio_group_device_put(int vfio_group_fd)
 	int i;
 
 	i = get_vfio_group_idx(vfio_group_fd);
-	if (i < 0 || i > VFIO_MAX_GROUPS)
+	if (i < 0 || i > (VFIO_MAX_GROUPS - 1))
 		RTE_LOG(ERR, EAL, "  wrong vfio_group index (%d)\n", i);
 	else
 		vfio_cfg.vfio_groups[i].devices--;
@@ -213,7 +213,7 @@ vfio_group_device_count(int vfio_group_fd)
 	int i;
 
 	i = get_vfio_group_idx(vfio_group_fd);
-	if (i < 0 || i > VFIO_MAX_GROUPS) {
+	if (i < 0 || i > (VFIO_MAX_GROUPS - 1)) {
 		RTE_LOG(ERR, EAL, "  wrong vfio_group index (%d)\n", i);
 		return -1;
 	}
-- 
2.7.4



More information about the stable mailing list