Files
linux/kernel/trace
Masami Hiramatsu (Google) c15120853e tracing/uprobes: Fix memory leak of tail in __trace_uprobe_create()
When generating a default event name in __trace_uprobe_create(), tail is
allocated with kstrdup() without __free(kfree). If the subsequent
kmalloc() for buf fails, the function returns -ENOMEM immediately and
leaks tail.

Declare tail with __free(kfree) so it is automatically freed on all
exit paths.

Link: https://lore.kernel.org/all/179455856197.403392.16569431894958507645.stgit@devnote2/

Reported-by: Sashiko <[email protected]>
Closes: https://lore.kernel.org/all/[email protected]/
Fixes: 97e8230f89 ("tracing: uprobe-event: Allocate string buffers from heap")
Cc: [email protected]
Signed-off-by: Masami Hiramatsu (Google) <[email protected]>
2026-11-13 23:06:31 +09:00
..