]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
kallsyms/ftrace: set module buildid in ftrace_mod_address_lookup()
authorPetr Mladek <pmladek@suse.com>
Fri, 28 Nov 2025 13:59:19 +0000 (14:59 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 21 Jan 2026 03:44:22 +0000 (19:44 -0800)
commite8a1e7eaa19d0b757b06a2f913e3eeb4b1c002c6
treec3ba2d4ccd4298d0a19e059d93fc29fe9bae5c02
parentcd6735896d0343942cf3dafb48ce32eb79341990
kallsyms/ftrace: set module buildid in ftrace_mod_address_lookup()

__sprint_symbol() might access an invalid pointer when
kallsyms_lookup_buildid() returns a symbol found by
ftrace_mod_address_lookup().

The ftrace lookup function must set both @modname and @modbuildid the same
way as module_address_lookup().

Link: https://lkml.kernel.org/r/20251128135920.217303-7-pmladek@suse.com
Fixes: 9294523e3768 ("module: add printk formats to add module build ID to stacktraces")
Signed-off-by: Petr Mladek <pmladek@suse.com>
Reviewed-by: Aaron Tomlin <atomlin@atomlin.com>
Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkman <daniel@iogearbox.net>
Cc: Daniel Gomez <da.gomez@samsung.com>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: Kees Cook <kees@kernel.org>
Cc: Luis Chamberalin <mcgrof@kernel.org>
Cc: Marc Rutland <mark.rutland@arm.com>
Cc: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
Cc: Petr Pavlu <petr.pavlu@suse.com>
Cc: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/ftrace.h
kernel/kallsyms.c
kernel/trace/ftrace.c