[PATCH v1] ethdev: fix address sanitizer bug
Ankur Dwivedi
adwivedi at marvell.com
Thu Mar 16 10:48:08 CET 2023
With clang 10 compilation, the address sanitizer reports global buffer
overflow issue. The issue is observed during trace point registration
in rte_trace_point_emit_string, for strings in iterator structure.
As a workaround for this clang issue, this patch removes the
rte_trace_point_emit_string and instead adds rte_trace_point_emit_ptr
to capture the iterator pointer.
Bugzilla ID: 1184
Fixes: 6679cf21d608 ("ethdev: add trace points")
Signed-off-by: Ankur Dwivedi <adwivedi at marvell.com>
---
lib/ethdev/ethdev_trace.h | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/lib/ethdev/ethdev_trace.h b/lib/ethdev/ethdev_trace.h
index c57ed08d36..3dc7d028b8 100644
--- a/lib/ethdev/ethdev_trace.h
+++ b/lib/ethdev/ethdev_trace.h
@@ -100,16 +100,14 @@ RTE_TRACE_POINT(
RTE_TRACE_POINT(
rte_eth_trace_iterator_next,
RTE_TRACE_POINT_ARGS(const struct rte_dev_iterator *iter, uint16_t id),
- rte_trace_point_emit_string(iter->bus_str);
- rte_trace_point_emit_string(iter->cls_str);
+ rte_trace_point_emit_ptr(iter);
rte_trace_point_emit_u16(id);
)
RTE_TRACE_POINT(
rte_eth_trace_iterator_cleanup,
RTE_TRACE_POINT_ARGS(const struct rte_dev_iterator *iter),
- rte_trace_point_emit_string(iter->bus_str);
- rte_trace_point_emit_string(iter->cls_str);
+ rte_trace_point_emit_ptr(iter);
)
RTE_TRACE_POINT(
--
2.25.1
More information about the dev
mailing list