]> Gentwo Git Trees - linux/.git/commit
maple_tree: fix tracepoint string pointers
authorMartin Kaiser <martin@kaiser.cx>
Thu, 30 Oct 2025 15:55:05 +0000 (16:55 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 10 Nov 2025 05:19:45 +0000 (21:19 -0800)
commit91a54090026f84ceffaa12ac53c99b9f162946f6
treedd0e8a9b88e448eec9b080def44bf5400d7f5a1f
parent1abbdf3d57aa964e572940d67c9ec5dc87710738
maple_tree: fix tracepoint string pointers

maple_tree tracepoints contain pointers to function names. Such a pointer
is saved when a tracepoint logs an event. There's no guarantee that it's
still valid when the event is parsed later and the pointer is dereferenced.

The kernel warns about these unsafe pointers.

event 'ma_read' has unsafe pointer field 'fn'
WARNING: kernel/trace/trace.c:3779 at ignore_event+0x1da/0x1e4

Mark the function names as tracepoint_string() to fix the events.

One case that doesn't work without my patch would be trace-cmd record
to save the binary ringbuffer and trace-cmd report to parse it in
userspace.  The address of __func__ can't be dereferenced from
userspace but tracepoint_string will add an entry to
/sys/kernel/tracing/printk_formats

Link: https://lkml.kernel.org/r/20251030155537.87972-1-martin@kaiser.cx
Fixes: 54a611b60590 ("Maple Tree: add new data structure")
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Acked-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/maple_tree.c