OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
From: "Eva Kurchatova (Virtuozzo)" <eva.kurchatova@virtuozzo.com>
To: khorenko@virtuozzo.com, vladimir.riabchun@virtuozzo.com
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.2 v2 00/28] ms/objtool: fix silently wrong livepatches by klp-build
Date: Thu, 26 Nov 2026 08:15:29 +0200	[thread overview]
Message-ID: <fd823c0a-5d12-41f0-ba08-7a0249941bc6@virtuozzo.com> (raw)
In-Reply-To: <20261126060620.2126341-2-eva.kurchatova@virtuozzo.com>


On 11/26/26 07:06, Eva Kurchatova wrote:
> Patchset for tasks:
> https://virtuozzo.atlassian.net/browse/VSTOR-128510
> https://virtuozzo.atlassian.net/browse/VSTOR-156924
> https://virtuozzo.atlassian.net/browse/VSTOR-157091
>
> klp-build in 26.x is the RHEL 10.2 import. Mainline has fixed many bugs
> in it since, and the objtool in it fails 31 of 48 mainline tests.
>
> This series takes only the mainline fixes for bugs that a vz10 build
> (x86_64, gcc) can hit and that make klp-build produce a livepatch which
> builds but is broken, or refuse a common patch. Patches 1-19 are for
> VSTOR-128510, patches 20-28 for VSTOR-156924 (1-19 are prerequisites):
>
> - pointers to const data compared against a private copy (13)
> - klp relocations to exports of another module put in a section the
>    livepatch loader never applies, e.g. jump into garbage (16-18)
> - static symbols bound to an export of the same name (19)
> - strings and data cloned at the wrong offset (3, 4)
> - module static keys not rejected at build time (1, 6)
> - WARN_ONCE() flags correlated between unrelated call sites (5)
> - functions using pr_debug() in modules can't be patched (2); objtool
>    crashes on empty sections (8) and corrupts a relocation (10)
> - symbol positions of the same-named static symbols counted in same
>    order as vmlinux.o, which the final link reorders (22, 23, 25, 28)
> - match the .cold part of a function by name (20)
> - fix NULL dereference when printing a code symbol (21)
> - fix x86 alternative replacement (24, 26)
> - fix new references to an export of another module (27)
>
> Patches 7, 9, 11 and 12 are mainline prerequisites of 13. The picks
> match mainline line for line, except 22 and 23, which have a rebase
> note.
>
> Since patch 13, a named const object is correlated, and the livepatch
> references the original. Patches 14 and 15 are original. Patch 15 makes
> klp diff fail when a correlated const object changes, replacing a much
> larger upstream correlation rewrite, 6016dd33a10a, too large to take.
> Patch 14 fixes an existing mainline problem, and fails klp diff if the
> section would be cloned due to one of its objects, or size-less one.
> See VSTOR-157091 for details, patch 14 to be sent mainline too.
>
> Patch 22 makes klp-build builds emit a .klp.symid table, a section that
> is not allocated; kernels built without klp-build do not change.
>
> Tested with klp-build on rh10-6.12.0-211.75.1.26.4.vz10 in QEMU.
>
> Changes in v3:
> - Merged the VSTOR-156924 proposal as patches 20-28, not posted before.
> - New patch 14: Check .rodata section labels and prevent object cloning.
> - Patch 15: Check an object which the patch makes const, compare only
>    the section of a target that no symbol contains, lowercase subject.
> - Cover letter: Renumber patches, update covered tasks.
>
> Link to v2: http://lore.virtuozzo.com/kernel/179560292324.21954.16900360366849940769.b4-review@b4/T/#t
>
> Changes in v2:
> - Patch 14: Fail klp diff when a correlated .rodata object changed.
> - Cover letter: Reflect the .rodata object handling change.
> - Reviewed-by: Sashiko on patches 1-12.
>
> Link to v1: http://lore.virtuozzo.com/kernel/20261124050655.1853940-1-eva.kurchatova@virtuozzo.com/T/#t
>
>
> Eva Kurchatova (2):
>    objtool/klp: use the section symbol for .rodata labels
>    objtool/klp: reject changed .rodata objects
>
> Joe Lawrence (4):
>    ms/objtool/klp: fix data alignment in __clone_symbol()
>    ms/objtool/klp: Fix create_fake_symbols() skipping entsize-based
>      sections
>    ms/objtool/klp: Normalize Module.symvers paths to module names
>    ms/objtool/klp: Allow new references to module exports
>
> Josh Poimboeuf (21):
>    ms/objtool/klp: Fix detection of corrupt static branch/call entries
>    ms/objtool/klp: Disable unsupported pr_debug() usage
>    ms/objtool: Fix data alignment in elf_add_data()
>    ms/objtool/klp: Fix .data..once static local non-correlation
>    ms/objtool/klp: Fix handling of zero-length .altinstr_replacement
>      sections
>    ms/objtool/klp: Fix cloning of zero-length section symbols
>    ms/objtool/klp: Fix relocation conversion failures for R_X86_64_NONE
>    ms/objtool/klp: Fix reloc corruption in convert_reloc_sym_to_secsym()
>    ms/objtool/klp: Simplify reloc symbol conversion
>    ms/objtool: Move mark_rodata() to elf.c
>    ms/objtool/klp: Fix pointer comparisons for rodata objects
>    ms/objtool/klp: Fix module name normalization for paths with dots
>    ms/objtool/klp: Fix cross-module klp relocation section naming
>    ms/objtool/klp: Don't match local symbols against exports
>    ms/objtool: Fix .cold function detection for duplicate symbols
>    ms/objtool/klp: Avoid NULL pointer dereference when printing code
>      symbol name
>    ms/objtool/klp: Add .klp.symid for sympos disambiguation
>    ms/objtool/klp: Fix symbol resolution for duplicate data symbols
>    ms/objtool/klp: Fix size of empty special section entries
>    ms/objtool/klp: Fix vmlinux .klp.symid link error for .no_trim_symbol
>      symbols
>    ms/objtool/klp: Ignore replacement offset of empty x86 alternatives
>
> Puranjay Mohan (1):
>    ms/objtool/klp: Fix vmlinux .klp.symid link error for .exitcall.exit
>      symbols
>
>   include/asm-generic/vmlinux.lds.h       |  10 +-
>   scripts/Makefile.vmlinux_o              |   3 +
>   scripts/livepatch/klp-build             |   7 +
>   scripts/mod/modpost.c                   |   1 +
>   tools/objtool/Build                     |   4 +-
>   tools/objtool/arch/x86/special.c        |  27 ++
>   tools/objtool/builtin-check.c           |   7 +
>   tools/objtool/check.c                   |  18 +-
>   tools/objtool/elf.c                     |  69 +++-
>   tools/objtool/include/objtool/builtin.h |   1 +
>   tools/objtool/include/objtool/elf.h     |  25 +-
>   tools/objtool/include/objtool/klp.h     |  29 +-
>   tools/objtool/include/objtool/special.h |   7 +
>   tools/objtool/klp-diff.c                | 471 ++++++++++++++++--------
>   tools/objtool/klp-post-link.c           |  53 +--
>   tools/objtool/klp-symid.c               | 119 ++++++
>   tools/objtool/klp-sympos.c              | 411 +++++++++++++++++++++
>   17 files changed, 1073 insertions(+), 189 deletions(-)
>   create mode 100644 tools/objtool/klp-symid.c
>   create mode 100644 tools/objtool/klp-sympos.c


Sorry, wrong series version. This is a v3, as mentioned throughout the 
rest of the cover letter. I missed part of the git invocation shell 
auto-fill and didn't fix it up in editor. I can re-send if needed.

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

  parent reply	other threads:[~2026-11-26  6:16 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26  5:06 Eva Kurchatova
2026-11-26  5:07 ` [Devel] [PATCH hci-8.2 v2 01/28] ms/objtool/klp: Fix detection of corrupt static branch/call entries Eva Kurchatova
2026-11-26  5:07 ` [Devel] [PATCH hci-8.2 v2 02/28] ms/objtool/klp: Disable unsupported pr_debug() usage Eva Kurchatova
2026-11-26  5:07 ` [Devel] [PATCH hci-8.2 v2 03/28] ms/objtool: Fix data alignment in elf_add_data() Eva Kurchatova
2026-11-26  5:07 ` [Devel] [PATCH hci-8.2 v2 04/28] ms/objtool/klp: fix data alignment in __clone_symbol() Eva Kurchatova
2026-11-26  5:07 ` [Devel] [PATCH hci-8.2 v2 05/28] ms/objtool/klp: Fix .data..once static local non-correlation Eva Kurchatova
2026-11-26  5:07 ` [Devel] [PATCH hci-8.2 v2 06/28] ms/objtool/klp: Fix create_fake_symbols() skipping entsize-based sections Eva Kurchatova
2026-11-26  5:07 ` [Devel] [PATCH hci-8.2 v2 07/28] ms/objtool/klp: Fix handling of zero-length .altinstr_replacement sections Eva Kurchatova
2026-11-26  5:07 ` [Devel] [PATCH hci-8.2 v2 08/28] ms/objtool/klp: Fix cloning of zero-length section symbols Eva Kurchatova
2026-11-26  5:07 ` [Devel] [PATCH hci-8.2 v2 09/28] ms/objtool/klp: Fix relocation conversion failures for R_X86_64_NONE Eva Kurchatova
2026-11-26  5:07 ` [Devel] [PATCH hci-8.2 v2 10/28] ms/objtool/klp: Fix reloc corruption in convert_reloc_sym_to_secsym() Eva Kurchatova
2026-11-26  5:07 ` [Devel] [PATCH hci-8.2 v2 11/28] ms/objtool/klp: Simplify reloc symbol conversion Eva Kurchatova
2026-11-26  5:07 ` [Devel] [PATCH hci-8.2 v2 12/28] ms/objtool: Move mark_rodata() to elf.c Eva Kurchatova
2026-11-26  5:07 ` [Devel] [PATCH hci-8.2 v2 13/28] ms/objtool/klp: Fix pointer comparisons for rodata objects Eva Kurchatova
2026-11-26  5:07 ` [Devel] [PATCH hci-8.2 v2 14/28] objtool/klp: use the section symbol for .rodata labels Eva Kurchatova
2026-11-26  5:07 ` [Devel] [PATCH hci-8.2 v2 15/28] objtool/klp: reject changed .rodata objects Eva Kurchatova
2026-11-26  5:07 ` [Devel] [PATCH hci-8.2 v2 16/28] ms/objtool/klp: Fix module name normalization for paths with dots Eva Kurchatova
2026-11-26  5:07 ` [Devel] [PATCH hci-8.2 v2 17/28] ms/objtool/klp: Normalize Module.symvers paths to module names Eva Kurchatova
2026-11-26  5:07 ` [Devel] [PATCH hci-8.2 v2 18/28] ms/objtool/klp: Fix cross-module klp relocation section naming Eva Kurchatova
2026-11-26  5:07 ` [Devel] [PATCH hci-8.2 v2 19/28] ms/objtool/klp: Don't match local symbols against exports Eva Kurchatova
2026-11-26  5:07 ` [Devel] [PATCH hci-8.2 v2 20/28] ms/objtool: Fix .cold function detection for duplicate symbols Eva Kurchatova
2026-11-26  5:07 ` [Devel] [PATCH hci-8.2 v2 21/28] ms/objtool/klp: Avoid NULL pointer dereference when printing code symbol name Eva Kurchatova
2026-11-26  5:07 ` [Devel] [PATCH hci-8.2 v2 22/28] ms/objtool/klp: Add .klp.symid for sympos disambiguation Eva Kurchatova
2026-11-26  5:07 ` [Devel] [PATCH hci-8.2 v2 23/28] ms/objtool/klp: Fix symbol resolution for duplicate data symbols Eva Kurchatova
2026-11-26  5:07 ` [Devel] [PATCH hci-8.2 v2 24/28] ms/objtool/klp: Fix size of empty special section entries Eva Kurchatova
2026-11-26  5:07 ` [Devel] [PATCH hci-8.2 v2 25/28] ms/objtool/klp: Fix vmlinux .klp.symid link error for .no_trim_symbol symbols Eva Kurchatova
2026-11-26  5:07 ` [Devel] [PATCH hci-8.2 v2 26/28] ms/objtool/klp: Ignore replacement offset of empty x86 alternatives Eva Kurchatova
2026-11-26  5:07 ` [Devel] [PATCH hci-8.2 v2 27/28] ms/objtool/klp: Allow new references to module exports Eva Kurchatova
2026-11-26  5:07 ` [Devel] [PATCH hci-8.2 v2 28/28] ms/objtool/klp: Fix vmlinux .klp.symid link error for .exitcall.exit symbols Eva Kurchatova
2026-11-26  6:15 ` Eva Kurchatova (Virtuozzo) [this message]
2026-11-26 16:34 ` [Devel] [PATCH hci-8.2 v3 00/28] ms/objtool: fix silently wrong livepatches by klp-build Konstantin Khorenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fd823c0a-5d12-41f0-ba08-7a0249941bc6@virtuozzo.com \
    --to=eva.kurchatova@virtuozzo.com \
    --cc=devel@openvz.org \
    --cc=khorenko@virtuozzo.com \
    --cc=vladimir.riabchun@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox