From: no-reply@sashiko.virtuozzo.com
To: Konstantin Khorenko <khorenko@virtuozzo.com>,
Eva Kurchatova <eva.kurchatova@virtuozzo.com>,
Vasileios Almpanis <vasileios.almpanis@virtuozzo.com>
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.2 6/6] ms/objtool/klp: Fix checksums for constant pool references
Date: Tue, 1 Dec 2026 00:45:38 +0000 [thread overview]
Message-ID: <010701a22f10775b-6b67c9cb-b5d1-4b7c-962a-e928da016895-000000@eu-central-1.amazonses.com> (raw)
In-Reply-To: <20261126-khorenko-vstor-157128-more-klp-build-fixes-v1-6-69a0363954e4@virtuozzo.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] objtool: unchecked sh_entsize-byte hash read in anonymous const
data checksum
--
commit 6c01ff96123a5a330a3e5f3c2a72de8401de72c0
Author: Josh Poimboeuf <jpoimboe@kernel.org>
ms/objtool/klp: Fix checksums for constant pool references
When a function references an .LC* symbol or anonymous data in a .rodata.cst<num> section, the checksum now covers the constant's contents instead of the symbol name. This avoids false "changed function" reports when the compiler renumbers .LC symbols.
Link: https://patch.msgid.link/f3a9e74ceebc6475ce94bcfe985401140857814a.1787939301.git.jpoimboe@kernel.org
> diff --git a/tools/objtool/check.c b/tools/objtool/check.c
> index 403da0d3739a6..17d6735032408 100644
> --- a/tools/objtool/check.c
> +++ b/tools/objtool/check.c
> @@ -3665,6 +3678,14 @@ static void checksum_update_insn(struct objtool_file *file, struct symbol *func,
> return;
> }
>
> + if (is_anonymous_const_data(sym)) {
> + void *cst;
> +
> + cst = sym->sec->data->d_buf + sym->offset + offset;
> + checksum_update(func, insn, cst, sym->sec->sh.sh_entsize);
> + return;
> + }
> +
[Severity: Low]
Can this read past the intended constant? The pointer is d_buf + sym->offset + offset, and a fixed sh_entsize bytes are hashed from it, with no check against the section size and no check that the offset is entry-aligned.
If a relocation addend points into the middle of a .rodata.cst<N> entry, such as .LC0+8 for a 16-byte constant, the hash covers part of the next constant. For the last entry it reads past the end of the section buffer. The result is a wrong checksum, which means a spurious or missed changed-function report, or a small heap over-read in the tool.
Would it be worth validating that the offset plus sh_entsize stays within sh_size, and that sh_entsize is non-zero, before hashing?
Carry the trailer below into the next revision and Sashiko will not review this patch again.
Reviewed-by: Sashiko <no-reply@sashiko.virtuozzo.com>
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261126-khorenko-vstor-157128-more-klp-build-fixes-v1-0-69a0363954e4@virtuozzo.com?part=6
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next prev parent reply other threads:[~2026-12-01 0:46 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 21:51 [Devel] [PATCH hci-8.2 0/6] objtool/klp: more upstream klp-build fixes for the 8.2 kernel Konstantin Khorenko
2026-11-26 21:51 ` [Devel] [PATCH hci-8.2 1/6] ms/objtool/klp: Fix bug table handling for __WARN_printf() Konstantin Khorenko
2026-12-01 0:41 ` no-reply
2026-11-26 21:51 ` [Devel] [PATCH hci-8.2 2/6] ms/objtool/klp: Fix extraction of text annotations for alternatives Konstantin Khorenko
2026-12-01 0:41 ` no-reply
2026-11-26 21:51 ` [Devel] [PATCH hci-8.2 3/6] ms/objtool/klp: Fix false module dependencies caused by dead relocs Konstantin Khorenko
2026-12-01 0:43 ` no-reply
2026-11-26 21:51 ` [Devel] [PATCH hci-8.2 4/6] ms/objtool/klp: Explicitly disallow patching or referencing init code/data Konstantin Khorenko
2026-12-01 0:43 ` no-reply
2026-11-26 21:51 ` [Devel] [PATCH hci-8.2 5/6] ms/klp-build: Fix wrong index in funcs cleanup error path Konstantin Khorenko
2026-12-01 0:44 ` no-reply
2026-11-26 21:51 ` [Devel] [PATCH hci-8.2 6/6] ms/objtool/klp: Fix checksums for constant pool references Konstantin Khorenko
2026-12-01 0:45 ` no-reply [this message]
2026-11-27 14:42 ` [Devel] [PATCH hci-8.2 0/6] objtool/klp: more upstream klp-build fixes for the 8.2 kernel 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=010701a22f10775b-6b67c9cb-b5d1-4b7c-962a-e928da016895-000000@eu-central-1.amazonses.com \
--to=no-reply@sashiko.virtuozzo.com \
--cc=devel@openvz.org \
--cc=eva.kurchatova@virtuozzo.com \
--cc=khorenko@virtuozzo.com \
--cc=vasileios.almpanis@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