patch 'net/bonding: prevent crash on Rx/Tx from secondary process' has been queued to stable release 24.11.7
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Mon Jul 6 12:20:47 CEST 2026
Hi,
FYI, your patch has been queued to stable release 24.11.7
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/05/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/3c59569655eb8a7a4c6e092d3ba84c1b6bcd9425
Thanks.
Luca Boccassi
---
>From 3c59569655eb8a7a4c6e092d3ba84c1b6bcd9425 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Fri, 17 Apr 2026 09:32:19 -0700
Subject: [PATCH] net/bonding: prevent crash on Rx/Tx from secondary process
[ upstream commit 6d77d081d8bcf24a6203aae375b68ff070aa57d8 ]
The bonding PMD's secondary process attach path registered the
ethdev but never installed rx_pkt_burst or tx_pkt_burst, leaving
both as NULL. Any rx_burst or tx_burst call from a secondary
process therefore crashed with a NULL pointer dereference.
Fully sharing bonding state across processes would be
overly complex. Instead, install blackhole burst functions
in the secondary so the data path is safe by default. Rx returns 0
and Tx frees the mbufs and reports them as transmitted,
matching /dev/null semantics so applications do not spin
retrying. Each stub logs once at NOTICE level on first use.
Also reject bond mode changes from a secondary process.
rte_eth_bond_mode_set() is callable from secondary, and
without this guard it would overwrite the secondary's safe
burst stubs with real per-mode functions whose internal
state is not valid outside the primary, reintroducing the
crash by another path.
This keeps secondary support available for the more
common use cases of procinfo and packet capture.
Bugzilla ID: 1698
Fixes: 4852aa8f6e21 ("drivers/net: enable hotplug on secondary process")
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
drivers/net/bonding/rte_eth_bond_pmd.c | 43 +++++++++++++++++++++++++-
1 file changed, 42 insertions(+), 1 deletion(-)
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index bb5a38a202..8f8d465999 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -56,6 +56,33 @@ get_vlan_offset(struct rte_ether_hdr *eth_hdr, uint16_t *proto)
return vlan_offset;
}
+static uint16_t
+bond_ethdev_rx_secondary(void *queue __rte_unused,
+ struct rte_mbuf **bufs __rte_unused, uint16_t nb_pkts __rte_unused)
+{
+ static bool once = true;
+
+ if (once) {
+ /* once per process is enough of a notice */
+ RTE_BOND_LOG(ERR, "receive not supported in secondary");
+ once = false;
+ }
+ return 0;
+}
+
+static uint16_t
+bond_ethdev_tx_secondary(void *queue __rte_unused, struct rte_mbuf **bufs, uint16_t nb_pkts)
+{
+ static bool once = true;
+
+ if (once) {
+ RTE_BOND_LOG(ERR, "transmit not supported in secondary");
+ once = false;
+ }
+ rte_pktmbuf_free_bulk(bufs, nb_pkts);
+ return nb_pkts;
+}
+
static uint16_t
bond_ethdev_rx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
{
@@ -1599,6 +1626,11 @@ bond_ethdev_mode_set(struct rte_eth_dev *eth_dev, uint8_t mode)
{
struct bond_dev_private *internals;
+ if (rte_eal_process_type() == RTE_PROC_SECONDARY) {
+ RTE_BOND_LOG(ERR, "Setting mode in secondary not allowed");
+ return -1;
+ }
+
internals = eth_dev->data->dev_private;
switch (mode) {
@@ -3797,9 +3829,18 @@ bond_probe(struct rte_vdev_device *dev)
RTE_BOND_LOG(ERR, "Failed to probe %s", name);
return -1;
}
- /* TODO: request info from primary to set up Rx and Tx */
+
eth_dev->dev_ops = &default_dev_ops;
eth_dev->device = &dev->device;
+
+ /*
+ * Propagation of bond mode would require adding
+ * MP client/server support and lots of error handling.
+ *
+ * For now just install a black hole.
+ */
+ eth_dev->tx_pkt_burst = bond_ethdev_tx_secondary;
+ eth_dev->rx_pkt_burst = bond_ethdev_rx_secondary;
rte_eth_dev_probing_finish(eth_dev);
return 0;
}
--
2.47.3
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-07-03 12:55:48.769988719 +0100
+++ 0055-net-bonding-prevent-crash-on-Rx-Tx-from-secondary-pr.patch 2026-07-03 12:55:46.698574716 +0100
@@ -1 +1 @@
-From 6d77d081d8bcf24a6203aae375b68ff070aa57d8 Mon Sep 17 00:00:00 2001
+From 3c59569655eb8a7a4c6e092d3ba84c1b6bcd9425 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 6d77d081d8bcf24a6203aae375b68ff070aa57d8 ]
+
@@ -30 +31,0 @@
-Cc: stable at dpdk.org
@@ -39 +40 @@
-index 7fcb3ec7d7..8a9c329fb8 100644
+index bb5a38a202..8f8d465999 100644
@@ -88 +89 @@
-@@ -3798,9 +3830,18 @@ bond_probe(struct rte_vdev_device *dev)
+@@ -3797,9 +3829,18 @@ bond_probe(struct rte_vdev_device *dev)
More information about the stable
mailing list