OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
From: Konstantin Khorenko <khorenko@virtuozzo.com>
To: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.2 v2 14/18] objtool/klp: Reject changed .rodata objects
Date: Wed, 25 Nov 2026 11:35:23 +0100	[thread overview]
Message-ID: <179560292325.21954.5109542986102527974.b4-review@b4> (raw)
In-Reply-To: <20261125061124.1995383-15-eva.kurchatova@virtuozzo.com>

I won't apply this version, please send v3 with the changes below.

- Also check a pair whose patched side is in .rodata: item 2.
- Do not compare the addend of an anonymous target: item 3.
- Lowercase subject: item 4 of the cover letter reply.

On Wed, 25 Nov 2026 08:03:56 +0200, Eva Kurchatova wrote:
> Subject: [PATCH hci-8.2 v2 14/18] objtool/klp: Reject changed .rodata objects

Item 4: a vz commit, so "objtool/klp: reject changed .rodata objects".

> +	for_each_sym(e->orig, orig) {
> +		if (!is_object_sym(orig) || !is_rodata_sec(orig->sec) || !orig->twin)
> +			continue;

Item 2: a fix that turns a writable table into a const one with new
contents correlates the two by name; the patched code gets a klp reloc
to the old writable object, and this loop skips the pair because the
original is not in .rodata. Before patch 13 the new contents were
cloned. Check the pair when either side is in .rodata; for a .bss
original sym_data() is NULL, so the memcmp() in object_changed() needs
the same guard as in reloc_changed().

> +	if (!orig_sym || !patched_sym)
> +		return orig_sym != patched_sym ||
> +		       strcmp(orig->sym->sec->name, patched->sym->sec->name) ||
> +		       arch_adjusted_addend(orig) != arch_adjusted_addend(patched);

Item 3: klp diff runs on the whole vmlinux.o, an ld -r link in which
the plain .rodata of all files is one section, and anonymous constants
(strings with an embedded NUL, constant pool data) stay there even with
-fdata-sections. A patch that adds or resizes one such constant in
kernel/sys.c moves every later anonymous constant, and the crypto
testmgr vector tables, which point at hundreds of them, then fail with
"changed data" although they did not change. Mainline skips such
targets in its checksum; compare the section name only, and fix the
last sentence of the message to match.

-- 
Konstantin Khorenko,
Virtuozzo Linux Kernel Team

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

  reply	other threads:[~2026-11-25 10:36 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25  6:03 [Devel] [PATCH hci-8.2 v2 00/18] ms/objtool: fix silently wrong livepatches by klp-build Eva Kurchatova
2026-11-25  6:03 ` [Devel] [PATCH hci-8.2 v2 01/18] ms/objtool/klp: Fix detection of corrupt static branch/call entries Eva Kurchatova
2026-11-25  6:03 ` [Devel] [PATCH hci-8.2 v2 02/18] ms/objtool/klp: Disable unsupported pr_debug() usage Eva Kurchatova
2026-11-25  6:03 ` [Devel] [PATCH hci-8.2 v2 03/18] ms/objtool: Fix data alignment in elf_add_data() Eva Kurchatova
2026-11-25  6:03 ` [Devel] [PATCH hci-8.2 v2 04/18] ms/objtool/klp: fix data alignment in __clone_symbol() Eva Kurchatova
2026-11-25  6:03 ` [Devel] [PATCH hci-8.2 v2 05/18] ms/objtool/klp: Fix .data..once static local non-correlation Eva Kurchatova
2026-11-25  6:03 ` [Devel] [PATCH hci-8.2 v2 06/18] ms/objtool/klp: Fix create_fake_symbols() skipping entsize-based sections Eva Kurchatova
2026-11-25  6:03 ` [Devel] [PATCH hci-8.2 v2 07/18] ms/objtool/klp: Fix handling of zero-length .altinstr_replacement sections Eva Kurchatova
2026-11-25  6:03 ` [Devel] [PATCH hci-8.2 v2 08/18] ms/objtool/klp: Fix cloning of zero-length section symbols Eva Kurchatova
2026-11-25  6:03 ` [Devel] [PATCH hci-8.2 v2 09/18] ms/objtool/klp: Fix relocation conversion failures for R_X86_64_NONE Eva Kurchatova
2026-11-25  6:03 ` [Devel] [PATCH hci-8.2 v2 10/18] ms/objtool/klp: Fix reloc corruption in convert_reloc_sym_to_secsym() Eva Kurchatova
2026-11-25  6:03 ` [Devel] [PATCH hci-8.2 v2 11/18] ms/objtool/klp: Simplify reloc symbol conversion Eva Kurchatova
2026-11-25  6:03 ` [Devel] [PATCH hci-8.2 v2 12/18] ms/objtool: Move mark_rodata() to elf.c Eva Kurchatova
2026-11-25  6:03 ` [Devel] [PATCH hci-8.2 v2 13/18] ms/objtool/klp: Fix pointer comparisons for rodata objects Eva Kurchatova
2026-11-25 10:35   ` Konstantin Khorenko
2026-11-25  6:03 ` [Devel] [PATCH hci-8.2 v2 14/18] objtool/klp: Reject changed .rodata objects Eva Kurchatova
2026-11-25 10:35   ` Konstantin Khorenko [this message]
2026-11-25  6:03 ` [Devel] [PATCH hci-8.2 v2 15/18] ms/objtool/klp: Fix module name normalization for paths with dots Eva Kurchatova
2026-11-25  6:03 ` [Devel] [PATCH hci-8.2 v2 16/18] ms/objtool/klp: Normalize Module.symvers paths to module names Eva Kurchatova
2026-11-25  6:03 ` [Devel] [PATCH hci-8.2 v2 17/18] ms/objtool/klp: Fix cross-module klp relocation section naming Eva Kurchatova
2026-11-25  6:04 ` [Devel] [PATCH hci-8.2 v2 18/18] ms/objtool/klp: Don't match local symbols against exports Eva Kurchatova
2026-11-25 10:35 ` [Devel] [PATCH hci-8.2 v2 00/18] 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=179560292325.21954.5109542986102527974.b4-review@b4 \
    --to=khorenko@virtuozzo.com \
    --cc=devel@openvz.org \
    --cc=eva.kurchatova@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