patch 'net/memif: do not close EAL-owned memseg FD' has been queued to stable release 24.11.9

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Nov 5 17:42:45 CET 2026


Hi,

FYI, your patch has been queued to stable release 24.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 11/07/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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/e383567ae9c3504860d557a958aa364b964fd672

Thanks.

Luca Boccassi

---
>From e383567ae9c3504860d557a958aa364b964fd672 Mon Sep 17 00:00:00 2001
From: Sriram Yagnaraman <sriram.yagnaraman at ericsson.com>
Date: Fri, 16 Oct 2026 21:58:51 +0200
Subject: [PATCH] net/memif: do not close EAL-owned memseg FD

[ upstream commit e17a3db0adf4906e1731ab11678e35bfd9dafd9a ]

In zero-copy mode the per-memseg regions (i > 0) take their fd from
rte_memseg_get_fd(), which rte_memory.h documents as EAL-internal and
read-only. Both memif_connect() and memif_free_regions() closed that fd,
so the next connect handed the peer a stale (possibly reused)
descriptor and the PMD closed a descriptor it does not own. Stop closing
it in both paths and just clear the region fd; the fd is not ours.

Fixes: 43b815d88188 ("net/memif: support zero-copy slave")

Suggested-by: Stephen Hemminger <stephen at networkplumber.org>
Signed-off-by: Sriram Yagnaraman <sriram.yagnaraman at ericsson.com>
---
 drivers/net/memif/rte_eth_memif.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c
index 375e1e80053..8acbddc5dc7 100644
--- a/drivers/net/memif/rte_eth_memif.c
+++ b/drivers/net/memif/rte_eth_memif.c
@@ -1287,9 +1287,9 @@ memif_free_regions(struct rte_eth_dev *dev)
 		if (r != NULL) {
 			/* This is memzone */
 			if (i > 0 && (pmd->flags & ETH_MEMIF_FLAG_ZERO_COPY)) {
+				/* memseg fd is owned by EAL, do not close */
 				r->addr = NULL;
-				if (r->fd > 0)
-					close(r->fd);
+				r->fd = -1;
 			}
 			if (r->addr != NULL) {
 				munmap(r->addr, r->region_size);
@@ -1609,8 +1609,7 @@ memif_connect(struct rte_eth_dev *dev)
 				}
 			}
 			if (i > 0 && (pmd->flags & ETH_MEMIF_FLAG_ZERO_COPY)) {
-				/* close memseg file */
-				close(mr->fd);
+				/* memseg fd is owned by EAL, do not close */
 				mr->fd = -1;
 			}
 		}
-- 
2.47.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-11-05 16:42:47.937329207 +0000
+++ 0078-net-memif-do-not-close-EAL-owned-memseg-FD.patch	2026-11-05 16:42:45.013063535 +0000
@@ -1 +1 @@
-From e17a3db0adf4906e1731ab11678e35bfd9dafd9a Mon Sep 17 00:00:00 2001
+From e383567ae9c3504860d557a958aa364b964fd672 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit e17a3db0adf4906e1731ab11678e35bfd9dafd9a ]
+
@@ -14 +15,0 @@
-Cc: stable at dpdk.org
@@ -23 +24 @@
-index 1d1d12e242..e753243440 100644
+index 375e1e80053..8acbddc5dc7 100644
@@ -26 +27 @@
-@@ -1289,9 +1289,9 @@ memif_free_regions(struct rte_eth_dev *dev)
+@@ -1287,9 +1287,9 @@ memif_free_regions(struct rte_eth_dev *dev)
@@ -38 +39 @@
-@@ -1611,8 +1611,7 @@ memif_connect(struct rte_eth_dev *dev)
+@@ -1609,8 +1609,7 @@ memif_connect(struct rte_eth_dev *dev)


More information about the stable mailing list