Re: [PATCH 4/4] objtool/klp: strip klp-induced module dependencies from livepatch modules

From
Josh Poimboeuf <hidden>
Date
2026-08-03 03:06:19
Reply to
Joe Lawrence, 2026-07-20
On Mon, Jul 20, 2026 at 10:56:58AM -0400, Joe Lawrence wrote:
The klp-diff pipeline creates weak UNDEF placeholder symbols for
cross-module references that will become klp-relocations.  When modpost
runs on the linked livepatch .ko, it sees these UNDEF symbols, resolves
them via Module.symvers, and adds the providing modules to the depends=
field in .modinfo.

These dependencies are unnecessary: klp-relocations are resolved by the
livepatch infrastructure at patch-enable time, not by the module loader.
Adding hard module dependencies defeats late-module patching, since the
kernel will refuse to load the livepatch module unless all depended
modules are already present.

Fix this by having klp-post-link strip any depends= entry that is only
the result of klp-symbol (.klp.sym.<mod>.*).  The check is conservative:
if any remaining SHN_UNDEF symbol matches a known export name from that
module, the dependency is kept (indicating a legitimate non-KLP
reference).

Assisted-by: Claude:claude-opus-4-6
Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
This patch is no longer needed in light of my tombstone patch which
should prevent modpost from adding those module dependencies in the
first place.

-- 
Josh
Thread (8 messages) 8 messages, 2 authors, last reply 2026-08-03
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help