* [PATCH v1] ethdev: fix address sanitizer bug
@ 2023-03-16 9:48 Ankur Dwivedi
2023-03-16 12:06 ` Ferruh Yigit
2023-03-17 3:06 ` Yuan, DukaiX
0 siblings, 2 replies; 3+ messages in thread
From: Ankur Dwivedi @ 2023-03-16 9:48 UTC (permalink / raw)
To: dev
Cc: dukaix.yuan, jerinj, thomas, ferruh.yigit, andrew.rybchenko,
skori, Ankur Dwivedi
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@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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v1] ethdev: fix address sanitizer bug
2023-03-16 9:48 [PATCH v1] ethdev: fix address sanitizer bug Ankur Dwivedi
@ 2023-03-16 12:06 ` Ferruh Yigit
2023-03-17 3:06 ` Yuan, DukaiX
1 sibling, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2023-03-16 12:06 UTC (permalink / raw)
To: Ankur Dwivedi, dev; +Cc: dukaix.yuan, jerinj, thomas, andrew.rybchenko, skori
On 3/16/2023 9:48 AM, Ankur Dwivedi wrote:
> 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@marvell.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
Applied to dpdk-next-net/main, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH v1] ethdev: fix address sanitizer bug
2023-03-16 9:48 [PATCH v1] ethdev: fix address sanitizer bug Ankur Dwivedi
2023-03-16 12:06 ` Ferruh Yigit
@ 2023-03-17 3:06 ` Yuan, DukaiX
1 sibling, 0 replies; 3+ messages in thread
From: Yuan, DukaiX @ 2023-03-17 3:06 UTC (permalink / raw)
To: Ankur Dwivedi, dev; +Cc: jerinj, thomas, ferruh.yigit, andrew.rybchenko, skori
> -----Original Message-----
> From: Ankur Dwivedi <adwivedi@marvell.com>
> Sent: 2023年3月16日 17:48
> To: dev@dpdk.org
> Cc: Yuan, DukaiX <dukaix.yuan@intel.com>; jerinj@marvell.com;
> thomas@monjalon.net; ferruh.yigit@amd.com;
> andrew.rybchenko@oktetlabs.ru; skori@marvell.com; Ankur Dwivedi
> <adwivedi@marvell.com>
> Subject: [PATCH v1] ethdev: fix address sanitizer bug
>
> 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@marvell.com>
> ---
Tested-by: Dukai Yuan<dukaix.yuan@intel.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-03-17 3:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-16 9:48 [PATCH v1] ethdev: fix address sanitizer bug Ankur Dwivedi
2023-03-16 12:06 ` Ferruh Yigit
2023-03-17 3:06 ` Yuan, DukaiX
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).