]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
kallsyms: cleanup code for appending the module buildid
authorPetr Mladek <pmladek@suse.com>
Fri, 28 Nov 2025 13:59:17 +0000 (14:59 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 21 Jan 2026 03:44:22 +0000 (19:44 -0800)
commit8e81dac4cd5477731169b92cff7c24f8f6635950
tree5e1d1f2d1bb2e9a7a632d2ceca2f78a8de0c0590
parentacfdbb4ab2910ff6f03becb569c23ac7b2223913
kallsyms: cleanup code for appending the module buildid

Put the code for appending the optional "buildid" into a helper function,
It makes __sprint_symbol() better readable.

Also print a warning when the "modname" is set and the "buildid" isn't.
It might catch a situation when some lookup function in
kallsyms_lookup_buildid() does not handle the "buildid".

Use pr_*_once() to avoid an infinite recursion when the function is called
from printk().  The recursion is rather theoretical but better be on the
safe side.

Link: https://lkml.kernel.org/r/20251128135920.217303-5-pmladek@suse.com
Signed-off-by: Petr Mladek <pmladek@suse.com>
Cc: Aaron Tomlin <atomlin@atomlin.com>
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>
Cc: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/kallsyms.c