patch 'net/af_packet: fix crash in secondary process' has been queued to stable release 22.11.11
    luca.boccassi at gmail.com 
    luca.boccassi at gmail.com
       
    Mon Oct 27 17:19:33 CET 2025
    
    
  
Hi,
FYI, your patch has been queued to stable release 22.11.11
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 10/29/25. 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/1abf7e31f268f3ec07df0ef96f612cc9f6a9d332
Thanks.
Luca Boccassi
---
>From 1abf7e31f268f3ec07df0ef96f612cc9f6a9d332 Mon Sep 17 00:00:00 2001
From: Kerem Aksu <kerem.aksu at i2i-systems.com>
Date: Fri, 12 Sep 2025 14:35:25 +0300
Subject: [PATCH] net/af_packet: fix crash in secondary process
[ upstream commit d57124f60ef60b24cd39e895cf6d211b93b897ae ]
dumpcap crashes when trying to capture from af_packet devices. This is
caused by allocating interface name with
strdup (i.e. malloc). Interface name is not accessible from secondary
process and causes segmentation fault. Use rte_malloc instead of
strdup to fix the issue.
Bugzilla ID: 1786
Fixes: 1b93c2aa81b4 ("net/af_packet: add interface name to internals")
Signed-off-by: Kerem Aksu <kerem.aksu at i2i-systems.com>
---
 .mailmap                                  | 1 +
 drivers/net/af_packet/rte_eth_af_packet.c | 7 ++++---
 2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/.mailmap b/.mailmap
index fb9c3d74f9..3ff821f286 100644
--- a/.mailmap
+++ b/.mailmap
@@ -729,6 +729,7 @@ Kefu Chai <tchaikov at gmail.com>
 Keiichi Watanabe <keiichiw at chromium.org>
 Keith Wiles <keith.wiles at intel.com> <keith.wiles at windriver.com>
 Kent Wires <kent.wires at intel.com>
+Kerem Aksu <kerem.aksu at i2i-systems.com>
 Keunhong Lee <dlrmsghd at gmail.com>
 Kevin Laatz <kevin.laatz at intel.com>
 Kevin Lampis <klampis at solarflare.com>
diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index 0b059bfd0b..6803502c74 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -462,7 +462,7 @@ eth_dev_close(struct rte_eth_dev *dev)
 		rte_free(internals->rx_queue[q].rd);
 		rte_free(internals->tx_queue[q].rd);
 	}
-	free(internals->if_name);
+	rte_free(internals->if_name);
 	rte_free(internals->rx_queue);
 	rte_free(internals->tx_queue);
 
@@ -752,9 +752,10 @@ rte_pmd_init_internals(struct rte_vdev_device *dev,
 		PMD_LOG_ERRNO(ERR, "%s: ioctl failed (SIOCGIFINDEX)", name);
 		goto free_internals;
 	}
-	(*internals)->if_name = strdup(pair->value);
+	(*internals)->if_name = rte_malloc_socket(name, ifnamelen + 1, 0, numa_node);
 	if ((*internals)->if_name == NULL)
 		goto free_internals;
+	strlcpy((*internals)->if_name, pair->value, ifnamelen + 1);
 	(*internals)->if_index = ifr.ifr_ifindex;
 
 	if (ioctl(sockfd, SIOCGIFHWADDR, &ifr) == -1) {
@@ -941,7 +942,7 @@ error:
 free_internals:
 	rte_free((*internals)->rx_queue);
 	rte_free((*internals)->tx_queue);
-	free((*internals)->if_name);
+	rte_free((*internals)->if_name);
 	rte_free(*internals);
 	return -1;
 }
-- 
2.47.3
---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-10-27 15:54:36.827302727 +0000
+++ 0055-net-af_packet-fix-crash-in-secondary-process.patch	2025-10-27 15:54:34.831950453 +0000
@@ -1 +1 @@
-From d57124f60ef60b24cd39e895cf6d211b93b897ae Mon Sep 17 00:00:00 2001
+From 1abf7e31f268f3ec07df0ef96f612cc9f6a9d332 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit d57124f60ef60b24cd39e895cf6d211b93b897ae ]
+
@@ -14 +15,0 @@
-Cc: stable at dpdk.org
@@ -23 +24 @@
-index ff13bf09fb..ff873856cb 100644
+index fb9c3d74f9..3ff821f286 100644
@@ -26 +27 @@
-@@ -830,6 +830,7 @@ Kefu Chai <tchaikov at gmail.com>
+@@ -729,6 +729,7 @@ Kefu Chai <tchaikov at gmail.com>
@@ -35 +36 @@
-index 85bc1201b4..de7ff63527 100644
+index 0b059bfd0b..6803502c74 100644
@@ -38 +39 @@
-@@ -525,7 +525,7 @@ eth_dev_close(struct rte_eth_dev *dev)
+@@ -462,7 +462,7 @@ eth_dev_close(struct rte_eth_dev *dev)
@@ -47 +48 @@
-@@ -875,9 +875,10 @@ rte_pmd_init_internals(struct rte_vdev_device *dev,
+@@ -752,9 +752,10 @@ rte_pmd_init_internals(struct rte_vdev_device *dev,
@@ -59 +60 @@
-@@ -1063,7 +1064,7 @@ error:
+@@ -941,7 +942,7 @@ error:
    
    
More information about the stable
mailing list