On Tue, Jun 30, 2026 at 10:00:11PM +0200, Martin Kaiser wrote:
subject need a tag to identify subsystem
dmaengine: fsl-edma: tracing: remove ptr dereference during log output
>
> The fsl edma events store a pointer to a struct fsl_edma_engine in the
> ringbuffer and dereference it when a log entry is printed. At this time,
> the pointer may no longer be valid.
>
> Event injection can be used to trigger a crash:
>
> $ cd /sys/kernel/tracing
> $ echo 'value = 0' > events/fsl_edma/edma_writeb/inject
> $ cat trace
>
> The log output needs only edma->membase. Add a membase field at the end
> of the event and use the new field for log output. Keep the existing
> fields for backward compatibility.
thanks you for your fix.
Frank
>
> Fixes: 11102d0c343b ("dmaengine: fsl-edma: add trace event support")
> Signed-off-by: Martin Kaiser <[email protected]>
> ---
> drivers/dma/fsl-edma-trace.h | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/dma/fsl-edma-trace.h b/drivers/dma/fsl-edma-trace.h
> index d3541301a247..45d964a3726d 100644
> --- a/drivers/dma/fsl-edma-trace.h
> +++ b/drivers/dma/fsl-edma-trace.h
> @@ -19,14 +19,16 @@ DECLARE_EVENT_CLASS(edma_log_io,
> __field(struct fsl_edma_engine *, edma)
> __field(void __iomem *, addr)
> __field(u32, value)
> + __field(void __iomem *, membase)
> ),
> TP_fast_assign(
> __entry->edma = edma;
> __entry->addr = addr;
> __entry->value = value;
> + __entry->membase = edma->membase;
> ),
> TP_printk("offset %08x: value %08x",
> - (u32)(__entry->addr - __entry->edma->membase), __entry->value)
> + (u32)(__entry->addr - __entry->membase), __entry->value)
> );
>
> DEFINE_EVENT(edma_log_io, edma_readl,
> --
> 2.43.7
>
>