patch 'net/memif: close file descriptor zero' has been queued to stable release 25.11.5

Kevin Traynor ktraynor at redhat.com
Thu Dec 3 14:03:57 CET 2026


Hi,

FYI, your patch has been queued to stable release 25.11.5

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/08/26. 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

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/3261dfce34ef1cf438b690c3d3b34c4b071e9b3d

Thanks.

Kevin

---
>From 3261dfce34ef1cf438b690c3d3b34c4b071e9b3d Mon Sep 17 00:00:00 2001
From: Sriram Yagnaraman <sriram.yagnaraman at ericsson.com>
Date: Fri, 16 Oct 2026 21:58:50 +0200
Subject: [PATCH] net/memif: close file descriptor zero

[ upstream commit 36bca982d92f42f24a663f4631b68f9e6c94c954 ]

Several cleanup paths guard close() with "fd > 0", which skips a valid
file descriptor of 0 and leaks it. A descriptor of 0 is legitimate (for
example when stdin has been closed before the region or interrupt fd is
created). Use ">= 0" consistently with the -1 sentinel the code already
uses elsewhere, in the memif_free_regions() shm munmap path, the
memif_region_init_shm() error path, the control-channel teardown in
memif_disconnect(), and the SCM_RIGHTS fd check in memif_msg_send().

Fixes: 09c7e63a71f9 ("net/memif: introduce memory interface PMD")

Signed-off-by: Sriram Yagnaraman <sriram.yagnaraman at ericsson.com>
---
 drivers/net/memif/memif_socket.c  | 4 ++--
 drivers/net/memif/rte_eth_memif.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/memif/memif_socket.c b/drivers/net/memif/memif_socket.c
index 475442231f..1eb71ee045 100644
--- a/drivers/net/memif/memif_socket.c
+++ b/drivers/net/memif/memif_socket.c
@@ -42,5 +42,5 @@ memif_msg_send(int fd, memif_msg_t *msg, int afd)
 	mh.msg_iovlen = 1;
 
-	if (afd > 0) {
+	if (afd >= 0) {
 		memset(&ctl, 0, sizeof(ctl));
 		mh.msg_control = ctl;
@@ -625,5 +625,5 @@ memif_disconnect(struct rte_eth_dev *dev)
 
 		ih = pmd->cc->intr_handle;
-		if (rte_intr_fd_get(ih) > 0) {
+		if (rte_intr_fd_get(ih) >= 0) {
 			ret = rte_intr_callback_unregister(ih,
 							memif_intr_handler,
diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c
index efd35f3629..b2d49813e2 100644
--- a/drivers/net/memif/rte_eth_memif.c
+++ b/drivers/net/memif/rte_eth_memif.c
@@ -1296,5 +1296,5 @@ memif_free_regions(struct rte_eth_dev *dev)
 			if (r->addr != NULL) {
 				munmap(r->addr, r->region_size);
-				if (r->fd > 0) {
+				if (r->fd >= 0) {
 					close(r->fd);
 					r->fd = -1;
@@ -1417,5 +1417,5 @@ memif_region_init_shm(struct rte_eth_dev *dev, uint8_t has_buffers)
 
 error:
-	if (r->fd > 0)
+	if (r->fd >= 0)
 		close(r->fd);
 	r->fd = -1;
-- 
2.56.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-12-03 12:52:48.010594584 +0000
+++ 0311-net-memif-close-file-descriptor-zero.patch	2026-12-03 12:52:39.244792709 +0000
@@ -1 +1 @@
-From 36bca982d92f42f24a663f4631b68f9e6c94c954 Mon Sep 17 00:00:00 2001
+From 3261dfce34ef1cf438b690c3d3b34c4b071e9b3d Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 36bca982d92f42f24a663f4631b68f9e6c94c954 ]
+
@@ -15 +16,0 @@
-Cc: stable at dpdk.org
@@ -24 +25 @@
-index b47c7a3b1b..e5a1249a9c 100644
+index 475442231f..1eb71ee045 100644
@@ -42 +43 @@
-index 36db03a268..1d1d12e242 100644
+index efd35f3629..b2d49813e2 100644



More information about the stable mailing list