diff options
author | Song Liu <song@kernel.org> | 2024-08-07 15:05:13 -0700 |
---|---|---|
committer | Kees Cook <kees@kernel.org> | 2024-08-15 09:33:35 -0700 |
commit | fb6a421fb6153d97cf3058f9bd550b377b76a490 (patch) | |
tree | 2b7d12e681ef5ed11ca5b9cb14ccf5bde56ec623 /scripts | |
parent | 020925ce92990c3bf59ab2cde386ac6d9ec734ff (diff) | |
download | linux-stable-fb6a421fb6153d97cf3058f9bd550b377b76a490.tar.gz linux-stable-fb6a421fb6153d97cf3058f9bd550b377b76a490.tar.bz2 linux-stable-fb6a421fb6153d97cf3058f9bd550b377b76a490.zip |
kallsyms: Match symbols exactly with CONFIG_LTO_CLANG
With CONFIG_LTO_CLANG=y, the compiler may add .llvm.<hash> suffix to
function names to avoid duplication. APIs like kallsyms_lookup_name()
and kallsyms_on_each_match_symbol() tries to match these symbol names
without the .llvm.<hash> suffix, e.g., match "c_stop" with symbol
c_stop.llvm.17132674095431275852. This turned out to be problematic
for use cases that require exact match, for example, livepatch.
Fix this by making the APIs to match symbols exactly.
Also cleanup kallsyms_selftests accordingly.
Signed-off-by: Song Liu <song@kernel.org>
Fixes: 8cc32a9bbf29 ("kallsyms: strip LTO-only suffixes from promoted global functions")
Tested-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Acked-by: Petr Mladek <pmladek@suse.com>
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
Link: https://lore.kernel.org/r/20240807220513.3100483-3-song@kernel.org
Signed-off-by: Kees Cook <kees@kernel.org>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions