[Devel] [PATCH hci-8.2 0/6] objtool/klp: more upstream klp-build fixes for the 8.2 kernel

Konstantin Khorenko khorenko at virtuozzo.com
Fri Nov 27 00:51:15 MSK 2026


Mainline klp-build fixes that the VSTOR-156924 series did not take.

- Patches 1-2: annotations inside alternative replacements (the
  ANNOTATE_RETPOLINE_SAFE of CALL_NOSPEC) are lost in the cloned code,
  and objtool then warns about the livepatch module. Patch 1 is
  context for patch 2.
- Patch 3 (VSTOR-157437): the placeholder relocations kept for klp
  relocations name the exported symbol, so modpost makes the livepatch
  depend on the exporting module (RK 10.14 for 20.14 has "depends:
  dm-mod").
- Patch 4 (VSTOR-157437): refuse a patch that changes or references
  init code or data. As upstream, this also refuses a change to a
  __ref function that uses init code or data only at boot.
- Patch 5: wrong index in the error path of the livepatch module init.
- Patch 6: a function checksum took the .LC<n> label of a constant
  pool entry (.rodata.cst*), not its data. A change to the constant
  alone was dropped by klp diff, and a renumbered label made unchanged
  functions look changed. Ported to check.c, 26.x has no
  klp-checksum.c.

Not taken:
- 51e1dfce24c8f: GCC puts no named objects into .rodata.cst*.
- 30cae58cdc13b: needs alternative types and features from the objtool
  disas series. Without it a change is not seen in a function that
  validate_branch() skips (STACK_FRAME_NON_STANDARD, e.g.
  __crash_kexec()), nor a change of only the CPU feature of an
  alternative.
- 4cd3cfb8b54fe, d8a2860b4a366: 26.x vmlinux has no
  EXPORT_SYMBOL_FOR_MODULES() exports.
- Clang, LTO and kCFI fixes, the checksum and correlation rewrites,
  klp-build usability changes.

Assisted-by: LLM
Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>

---
Josh Poimboeuf (5):
      ms/objtool/klp: Fix bug table handling for __WARN_printf()
      ms/objtool/klp: Fix extraction of text annotations for alternatives
      ms/objtool/klp: Fix false module dependencies caused by dead relocs
      ms/objtool/klp: Explicitly disallow patching or referencing init code/data
      ms/objtool/klp: Fix checksums for constant pool references

Yafang Shao (1):
      ms/klp-build: Fix wrong index in funcs cleanup error path

 scripts/livepatch/init.c            |  2 +-
 tools/objtool/check.c               | 21 +++++++++++++
 tools/objtool/elf.c                 | 13 ++++++++
 tools/objtool/include/objtool/klp.h |  2 ++
 tools/objtool/klp-diff.c            | 63 ++++++++++++++++++++++++++++++-------
 tools/objtool/klp-sympos.c          | 10 ++++++
 6 files changed, 98 insertions(+), 13 deletions(-)
---
base-commit: 9d3240d27f8b8c140461a96daa199ed0705ebe91
change-id: 20261126-khorenko-vstor-157128-more-klp-build-fixes-1b484cb13796

Best regards,
--  
Konstantin Khorenko,
Virtuozzo Linux Kernel Team



More information about the Devel mailing list