Re: [PATCH v2 0/2] objtool/klp: Copy constant pool entries for local labels
From: Josh Poimboeuf
Date: Wed Dec 02 2026 - 16:51:24 EST
On Mon, Nov 30, 2026 at 06:50:36PM -0500, Binoy Ravindran wrote:
> A small problem in __clone_symbol(): a .LC label in a .rodata.cst*
> pool has no size, so its constant is never copied into the livepatch
> module, and the patched function reads whatever bytes follow. Patch 1
> fixes it. Details and the three affected modules are in that patch.
>
> Patch 2 adds a test to tools/objtool/tests, as Joe suggested. With
> patch 1's change to klp-diff.c reverted it fails, and with the change
> in place it passes, under gcc 12.2.0 and clang 14.0.6. The whole suite
> passes under both compilers.
>
> One thing I noticed while running the suite: with a gcc built with
> --enable-default-pie, as Debian's is, -mnop-mcount is rejected,
> preflight falls back to objtool's mcount, and every gcc test that
> needs an ftrace call site fails with "no ftrace call site, can't
> patch". CC="gcc -fno-PIE -fcf-protection=none" avoids it. The kernel
> always builds with -fno-PIE, so FIXTURE_CFLAGS might want it as well.
> I can send a patch for that if it is useful.
>
> ---
> Changes in v2:
> - Add a test for the fix (Joe).
> - Add Joe's Acked-by to patch 1.
> - Link to v1: https://patch.msgid.link/20261127-objtool-klp-cst-v1-1-dc19b08c8676@xxxxxx
Queued, thanks!
--
Josh