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