patch 'net/tap: fix resource leaks on creation failure' has been queued to stable release 24.11.5
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Thu Mar 19 23:02:22 CET 2026
Hi,
FYI, your patch has been queued to stable release 24.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 03/21/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/95f3c95ad09094dfc39eb01978ba6a1dada7ae71
Thanks.
Luca Boccassi
---
>From 95f3c95ad09094dfc39eb01978ba6a1dada7ae71 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Sun, 22 Feb 2026 09:30:43 -0800
Subject: [PATCH] net/tap: fix resource leaks on creation failure
[ upstream commit 8c7751daa8a879f46b67969e1b995a99ed010869 ]
Correct two leaks in eth_dev_tap_create():
- process_private was never freed on error_exit. Add free() before
releasing the port.
- If the process_private malloc failed, the function returned -1
directly without releasing the ethdev port allocated by
rte_eth_vdev_allocate(). Jump to a new error_exit_nodev_release
label instead.
Bugzilla ID: 1881
Fixes: ed8132e7c912 ("net/tap: move fds of queues to be in process private")
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
drivers/net/tap/rte_eth_tap.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index 8e1d02c344..3e8cfcc38d 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -1928,7 +1928,7 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name,
process_private = malloc(sizeof(struct pmd_process_private));
if (process_private == NULL) {
TAP_LOG(ERR, "Failed to alloc memory for process private");
- return -1;
+ goto error_exit_nodev_release;
}
memset(process_private, 0, sizeof(struct pmd_process_private));
@@ -2134,9 +2134,12 @@ error_exit:
close(pmd->ka_fd);
if (pmd->ioctl_sock != -1)
close(pmd->ioctl_sock);
- /* mac_addrs must not be freed alone because part of dev_private */
- dev->data->mac_addrs = NULL;
rte_intr_instance_free(pmd->intr_handle);
+ free(dev->process_private);
+
+error_exit_nodev_release:
+ /* mac_addrs must not be freed alone because part of dev_private */
+ dev->data->mac_addrs = NULL;
rte_eth_dev_release_port(dev);
error_exit_nodev:
--
2.47.3
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-03-19 22:00:48.901043641 +0000
+++ 0030-net-tap-fix-resource-leaks-on-creation-failure.patch 2026-03-19 22:00:47.806359366 +0000
@@ -1 +1 @@
-From 8c7751daa8a879f46b67969e1b995a99ed010869 Mon Sep 17 00:00:00 2001
+From 95f3c95ad09094dfc39eb01978ba6a1dada7ae71 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 8c7751daa8a879f46b67969e1b995a99ed010869 ]
+
@@ -17 +18,0 @@
-Cc: stable at dpdk.org
@@ -25 +26 @@
-index 967cd7bf21..cf886b132c 100644
+index 8e1d02c344..3e8cfcc38d 100644
@@ -28 +29 @@
-@@ -1999,7 +1999,7 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name,
+@@ -1928,7 +1928,7 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name,
@@ -37,3 +38 @@
-@@ -2167,9 +2167,12 @@ error_exit:
- close(pmd->nlsk_fd);
- if (pmd->ka_fd != -1)
+@@ -2134,9 +2134,12 @@ error_exit:
@@ -40,0 +40,2 @@
+ if (pmd->ioctl_sock != -1)
+ close(pmd->ioctl_sock);
More information about the stable
mailing list