[dpdk-stable] patch 'vfio: fix close unchecked file descriptor' has been queued to LTS release 16.11.4

luca.boccassi at gmail.com luca.boccassi at gmail.com
Mon Oct 30 16:34:06 CET 2017


FYI, your patch has been queued to LTS release 16.11.4

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


Kind regards,
Luca Boccassi

>From 3542d6cbe47c7a30fa977367971c1874a6688d11 Mon Sep 17 00:00:00 2001
From: Kuba Kozak <kubax.kozak at intel.com>
Date: Thu, 21 Sep 2017 15:49:08 +0200
Subject: [PATCH] vfio: fix close unchecked file descriptor

[ upstream commit 96128b365eff2a1e5477e676c08c1fc631cc82c2 ]

Add file descriptor value check before calling close() function.

Coverity issue: 141297
Fixes: 811b6b25060f ("vfio: fix file descriptor leak in multi-process")

Signed-off-by: Kuba Kozak <kubax.kozak at intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov at intel.com>
Acked-by: Patrick MacArthur <patrick at patrickmacarthur.net>
 lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c b/lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c
index fb4a2f84b..f28891725 100644
--- a/lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c
+++ b/lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c
@@ -301,7 +301,8 @@ vfio_mp_sync_thread(void __rte_unused * arg)
 				vfio_mp_sync_send_request(conn_sock, SOCKET_ERR);
 				vfio_mp_sync_send_fd(conn_sock, fd);
-			close(fd);
+			if (fd >= 0)
+				close(fd);
 			/* wait for group number */

More information about the stable mailing list