patch 'drivers: fix ASan ODR violation on mlx glue symbols' has been queued to stable release 24.11.9
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Mon Nov 16 23:51:34 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/18/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/3410c4a6ab537b1a027e22c6e8700bcaba15d392
Thanks.
Luca Boccassi
---
>From 3410c4a6ab537b1a027e22c6e8700bcaba15d392 Mon Sep 17 00:00:00 2001
From: Maayan Kashani <mkashani at nvidia.com>
Date: Tue, 3 Nov 2026 13:25:24 +0200
Subject: [PATCH] drivers: fix ASan ODR violation on mlx glue symbols
[ upstream commit c0bb1db452158d4fc07057051995a6fa99c84858 ]
With ibverbs linked by dlopen, a static PMD and its glue library
each define one global. net/mlx4 and librte_net_mlx4_glue both
define mlx4_glue. common/mlx5 and librte_common_mlx5_glue both
define mlx5_glue. This is not a clash between mlx4 and mlx5.
Only AddressSanitizer detects this collision. The linker keeps one
copy, so a normal process is unaffected. AddressSanitizer records
both definitions and aborts at startup.
Keep the name dlsym() looks up in the glue library. Point the PMD
at that table through a private symbol.
Fixes: a5e5af7f20b4 ("net/mlx4: fix build with -fno-common")
Signed-off-by: Maayan Kashani <mkashani at nvidia.com>
Acked-by: Bing Zhao <bingz at nvidia.com>
---
drivers/common/mlx5/linux/meson.build | 2 +-
drivers/common/mlx5/linux/mlx5_common_os.c | 2 +-
drivers/common/mlx5/linux/mlx5_glue.h | 11 +++++++++++
drivers/common/mlx5/version.map | 1 +
drivers/net/mlx4/meson.build | 2 +-
drivers/net/mlx4/mlx4.c | 2 +-
drivers/net/mlx4/mlx4_glue.h | 11 +++++++++++
7 files changed, 27 insertions(+), 4 deletions(-)
diff --git a/drivers/common/mlx5/linux/meson.build b/drivers/common/mlx5/linux/meson.build
index 82e8046e0c..fc0603ea44 100644
--- a/drivers/common/mlx5/linux/meson.build
+++ b/drivers/common/mlx5/linux/meson.build
@@ -233,7 +233,7 @@ if dlopen_ibverbs
dlopen_lib_name,
dlopen_sources,
include_directories: dlopen_includes,
- c_args: cflags,
+ c_args: cflags + ['-DMLX5_GLUE_LIBRARY'],
dependencies: libs,
link_args: [
'-Wl,-export-dynamic',
diff --git a/drivers/common/mlx5/linux/mlx5_common_os.c b/drivers/common/mlx5/linux/mlx5_common_os.c
index 6fd852a3ba..a92eb6533c 100644
--- a/drivers/common/mlx5/linux/mlx5_common_os.c
+++ b/drivers/common/mlx5/linux/mlx5_common_os.c
@@ -27,7 +27,7 @@
#include "mlx5_glue.h"
#ifdef MLX5_GLUE
-const struct mlx5_glue *mlx5_glue;
+const mlx5_glue_t *mlx5_glue;
#endif
int
diff --git a/drivers/common/mlx5/linux/mlx5_glue.h b/drivers/common/mlx5/linux/mlx5_glue.h
index 81d6b0aaf9..ff9ac7c20a 100644
--- a/drivers/common/mlx5/linux/mlx5_glue.h
+++ b/drivers/common/mlx5/linux/mlx5_glue.h
@@ -410,6 +410,17 @@ struct mlx5_glue {
int (*destroy_steering_anchor)(struct mlx5dv_steering_anchor *sa);
};
+#if defined(RTE_IBVERBS_LINK_DLOPEN) && !defined(MLX5_GLUE_LIBRARY)
+/*
+ * The PMD keeps the address of the glue table in a private symbol. The glue
+ * library exports mlx5_glue for lookup with dlsym().
+ */
+typedef struct mlx5_glue mlx5_glue_t;
+
+extern const mlx5_glue_t *mlx5_glue_handle;
+#define mlx5_glue mlx5_glue_handle
+#else
extern const struct mlx5_glue *mlx5_glue;
+#endif
#endif /* MLX5_GLUE_H_ */
diff --git a/drivers/common/mlx5/version.map b/drivers/common/mlx5/version.map
index e79f8072da..249ed62b48 100644
--- a/drivers/common/mlx5/version.map
+++ b/drivers/common/mlx5/version.map
@@ -92,6 +92,7 @@ INTERNAL {
mlx5_get_pci_addr; # WINDOWS_NO_EXPORT
mlx5_glue;
+ mlx5_glue_handle; # WINDOWS_NO_EXPORT
mlx5_kvargs_process;
diff --git a/drivers/net/mlx4/meson.build b/drivers/net/mlx4/meson.build
index 3c5ee24186..a0539d46ea 100644
--- a/drivers/net/mlx4/meson.build
+++ b/drivers/net/mlx4/meson.build
@@ -123,7 +123,7 @@ if dlopen_ibverbs
dlopen_lib_name,
dlopen_sources,
include_directories: global_inc,
- c_args: cflags,
+ c_args: cflags + ['-DMLX4_GLUE_LIBRARY'],
dependencies: libs,
link_args: [
'-Wl,-export-dynamic',
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 997829a107..91241bebeb 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -50,7 +50,7 @@
#include "mlx4_utils.h"
#ifdef MLX4_GLUE
-const struct mlx4_glue *mlx4_glue;
+const mlx4_glue_t *mlx4_glue;
#endif
static const char *MZ_MLX4_PMD_SHARED_DATA = "mlx4_pmd_shared_data";
diff --git a/drivers/net/mlx4/mlx4_glue.h b/drivers/net/mlx4/mlx4_glue.h
index 96d5cb16b4..9209ce77cd 100644
--- a/drivers/net/mlx4/mlx4_glue.h
+++ b/drivers/net/mlx4/mlx4_glue.h
@@ -83,6 +83,17 @@ struct mlx4_glue {
void *attr);
};
+#if defined(MLX4_GLUE) && !defined(MLX4_GLUE_LIBRARY)
+/*
+ * The PMD keeps the address of the glue table in a private symbol. The glue
+ * library exports mlx4_glue for lookup with dlsym().
+ */
+typedef struct mlx4_glue mlx4_glue_t;
+
+extern const mlx4_glue_t *mlx4_glue_handle;
+#define mlx4_glue mlx4_glue_handle
+#else
extern const struct mlx4_glue *mlx4_glue;
+#endif
#endif /* MLX4_GLUE_H_ */
--
2.47.3
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-11-16 22:52:17.316951526 +0000
+++ 0020-drivers-fix-ASan-ODR-violation-on-mlx-glue-symbols.patch 2026-11-16 22:52:16.436232107 +0000
@@ -1 +1 @@
-From c0bb1db452158d4fc07057051995a6fa99c84858 Mon Sep 17 00:00:00 2001
+From 3410c4a6ab537b1a027e22c6e8700bcaba15d392 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit c0bb1db452158d4fc07057051995a6fa99c84858 ]
+
@@ -19 +20,0 @@
-Cc: stable at dpdk.org
@@ -25 +26 @@
- drivers/common/mlx5/linux/mlx5_common_os.c | 4 ++--
+ drivers/common/mlx5/linux/mlx5_common_os.c | 2 +-
@@ -26,0 +28 @@
+ drivers/common/mlx5/version.map | 1 +
@@ -30 +32 @@
- 6 files changed, 27 insertions(+), 5 deletions(-)
+ 7 files changed, 27 insertions(+), 4 deletions(-)
@@ -33 +35 @@
-index 3767e7a69b6..038b76b8447 100644
+index 82e8046e0c..fc0603ea44 100644
@@ -36 +38 @@
-@@ -245,7 +245,7 @@ if dlopen_ibverbs
+@@ -233,7 +233,7 @@ if dlopen_ibverbs
@@ -46 +48 @@
-index 903963670db..b8a7c53e5f3 100644
+index 6fd852a3ba..a92eb6533c 100644
@@ -49 +51 @@
-@@ -28,8 +28,8 @@
+@@ -27,7 +27,7 @@
@@ -53 +54,0 @@
--RTE_EXPORT_INTERNAL_SYMBOL(mlx5_glue)
@@ -55 +55,0 @@
-+RTE_EXPORT_INTERNAL_SYMBOL(mlx5_glue_handle)
@@ -59 +59 @@
- RTE_EXPORT_INTERNAL_SYMBOL(mlx5_get_pci_addr)
+ int
@@ -61 +61 @@
-index 0610e7778e1..38292c1346d 100644
+index 81d6b0aaf9..ff9ac7c20a 100644
@@ -64 +64 @@
-@@ -412,6 +412,17 @@ struct mlx5_glue {
+@@ -410,6 +410,17 @@ struct mlx5_glue {
@@ -81,0 +82,12 @@
+diff --git a/drivers/common/mlx5/version.map b/drivers/common/mlx5/version.map
+index e79f8072da..249ed62b48 100644
+--- a/drivers/common/mlx5/version.map
++++ b/drivers/common/mlx5/version.map
+@@ -92,6 +92,7 @@ INTERNAL {
+ mlx5_get_pci_addr; # WINDOWS_NO_EXPORT
+
+ mlx5_glue;
++ mlx5_glue_handle; # WINDOWS_NO_EXPORT
+
+ mlx5_kvargs_process;
+
@@ -83 +95 @@
-index 1eb67f3c472..fdef57f6812 100644
+index 3c5ee24186..a0539d46ea 100644
@@ -86 +98 @@
-@@ -125,7 +125,7 @@ if dlopen_ibverbs
+@@ -123,7 +123,7 @@ if dlopen_ibverbs
@@ -96 +108 @@
-index dbcd98d49f5..c5015bc03cb 100644
+index 997829a107..91241bebeb 100644
@@ -109 +121 @@
-index 96d5cb16b48..9209ce77cd5 100644
+index 96d5cb16b4..9209ce77cd 100644
More information about the stable
mailing list