All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] objtool/klp: Fix sympos for global/local symbol collisions
@ 2026-11-17  0:08 Wilson Felipe Pereira
  2026-11-17  0:08 ` [PATCH 1/2] objtool/klp: Disambiguate global symbols colliding with local symbols Wilson Felipe Pereira
  2026-11-17  0:08 ` [PATCH 2/2] objtool/klp: Add test for global/local symbol name collisions Wilson Felipe Pereira
  0 siblings, 2 replies; 4+ messages in thread
From: Wilson Felipe Pereira @ 2026-11-17  0:08 UTC (permalink / raw)
  To: Josh Poimboeuf, Peter Zijlstra, Miroslav Benes, Petr Mladek,
	Joe Lawrence, Song Liu
  Cc: live-patching, linux-kernel, Dylan Hatch, Yi Zhu,
	Wilson Felipe Pereira

When a defined STB_GLOBAL symbol in one translation unit shares its name
with a static (STB_LOCAL) symbol in another translation unit (for
example, cgroup_storage_lookup in kernel/bpf/local_storage.c vs
kernel/bpf/bpf_cgrp_storage.c), runtime kallsyms lookup counts both
symbols together. Emitting sympos 0 for the global symbol causes module
load to fail in klp_find_object_symbol() with "unresolvable ambiguity
for symbol".

Patch 1 disambiguates defined non-local symbols across .klp.symid
generation, klp_find_sympos(), and clone_reloc_klp() (while preserving
sympos 0 when unique). Patch 2 adds tests covering both module (.symtab
order) and vmlinux (.klp.symid address order) paths, including
EXPORT_SYMBOL_FOR_MODULES() exports.

Wilson Felipe Pereira (2):
  objtool/klp: Disambiguate global symbols colliding with local symbols
  objtool/klp: Add test for global/local symbol name collisions

 tools/objtool/klp-diff.c                      | 11 +++
 tools/objtool/klp-symid.c                     |  2 +-
 tools/objtool/klp-sympos.c                    |  9 +-
 .../tests/generic/fixtures/sympos_vmlinux.c   |  6 ++
 .../tests/generic/test-sympos-global-dup.sh   | 99 +++++++++++++++++++
 5 files changed, 123 insertions(+), 4 deletions(-)
 create mode 100755 tools/objtool/tests/generic/test-sympos-global-dup.sh


base-commit: 141b164bbe186423e295b139e40e8e2d11cf1341
-- 
2.56.1.703.gf848ed807c-goog


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-17  0:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-17  0:08 [PATCH 0/2] objtool/klp: Fix sympos for global/local symbol collisions Wilson Felipe Pereira
2026-11-17  0:08 ` [PATCH 1/2] objtool/klp: Disambiguate global symbols colliding with local symbols Wilson Felipe Pereira
2026-11-17  0:25   ` sashiko-bot
2026-11-17  0:08 ` [PATCH 2/2] objtool/klp: Add test for global/local symbol name collisions Wilson Felipe Pereira

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.