[dpdk-stable] patch 'vfio: fix use after free with multiprocess' has been queued to LTS release 18.11.9

Kevin Traynor ktraynor at redhat.com
Thu May 28 18:22:22 CEST 2020


Hi,

FYI, your patch has been queued to LTS release 18.11.9

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/03/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/8163def682be7bf3a26f705f413e38b2bf045015

Thanks.

Kevin.

---
>From 8163def682be7bf3a26f705f413e38b2bf045015 Mon Sep 17 00:00:00 2001
From: "Wei Hu (Xavier)" <xavier.huwei at huawei.com>
Date: Tue, 21 Apr 2020 11:29:57 +0800
Subject: [PATCH] vfio: fix use after free with multiprocess

[ upstream commit d6298844da7e3e83034f1af196bdfddf388f979e ]

This patch fixes the heap-use-after-free bug which was found by ASAN
(Address-Sanitizer) in the vfio_get_default_container_fd function.

Fixes: 6bcb7c95fe14 ("vfio: share default container in multi-process")

Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei at huawei.com>
Acked-by: Anatoly Burakov <anatoly.burakov at intel.com>
---
 lib/librte_eal/linuxapp/eal/eal_vfio.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c
index 4a995e11b3..b4619c2117 100644
--- a/lib/librte_eal/linuxapp/eal/eal_vfio.c
+++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c
@@ -1026,4 +1026,5 @@ vfio_get_default_container_fd(void)
 	struct timespec ts = {.tv_sec = 5, .tv_nsec = 0};
 	struct vfio_mp_param *p = (struct vfio_mp_param *)mp_req.param;
+	int container_fd;
 
 	if (default_vfio_cfg->vfio_enabled)
@@ -1048,6 +1049,7 @@ vfio_get_default_container_fd(void)
 		p = (struct vfio_mp_param *)mp_rep->param;
 		if (p->result == SOCKET_OK && mp_rep->num_fds == 1) {
+			container_fd = mp_rep->fds[0];
 			free(mp_reply.msgs);
-			return mp_rep->fds[0];
+			return container_fd;
 		}
 	}
-- 
2.21.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-05-28 17:13:00.964607806 +0100
+++ 0035-vfio-fix-use-after-free-with-multiprocess.patch	2020-05-28 17:12:59.096556514 +0100
@@ -1 +1 @@
-From d6298844da7e3e83034f1af196bdfddf388f979e Mon Sep 17 00:00:00 2001
+From 8163def682be7bf3a26f705f413e38b2bf045015 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit d6298844da7e3e83034f1af196bdfddf388f979e ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org
@@ -16 +17 @@
- lib/librte_eal/linux/eal_vfio.c | 4 +++-
+ lib/librte_eal/linuxapp/eal/eal_vfio.c | 4 +++-
@@ -19,5 +20,5 @@
-diff --git a/lib/librte_eal/linux/eal_vfio.c b/lib/librte_eal/linux/eal_vfio.c
-index 1979f6fdd8..d26e1649a5 100644
---- a/lib/librte_eal/linux/eal_vfio.c
-+++ b/lib/librte_eal/linux/eal_vfio.c
-@@ -1093,4 +1093,5 @@ vfio_get_default_container_fd(void)
+diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c
+index 4a995e11b3..b4619c2117 100644
+--- a/lib/librte_eal/linuxapp/eal/eal_vfio.c
++++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c
+@@ -1026,4 +1026,5 @@ vfio_get_default_container_fd(void)
@@ -29 +30 @@
-@@ -1115,6 +1116,7 @@ vfio_get_default_container_fd(void)
+@@ -1048,6 +1049,7 @@ vfio_get_default_container_fd(void)



More information about the stable mailing list