Re: [PATCH 03/14] objtool/klp: Fix false module dependencies caused by dead relocs
From: Dylan Hatch
Date: Fri Aug 14 2026 - 16:44:44 EST
Hi Josh,
On Wed, Aug 12, 2026 at 1:27 PM Josh Poimboeuf <jpoimboe@xxxxxxxxxx> wrote:
>
> On Wed, Aug 12, 2026 at 10:33:51AM -0700, Sean Christopherson wrote:
> > E.g. if (not-so-hypothetically) one were to try to livepatch
> > nested_vmx_enter_non_root_mode(), how would livepatch.ko get at things like
> > kvm_service_local_tlb_flush_requests() and kvm_spurious_fault() without also
> > creating copies of those functions? Wouldn't the kernel need something like the
> > below to exempt livepatch modules from the restriction?
>
> Indeed, though we approached it from the tooling side, see this (not yet
> merged) patched:
>
> https://lore.kernel.org/fe5a00818e06ec613344d41d5944de054fcd8832.1786138493.git.jpoimboe@xxxxxxxxxx
In the case where KVM is built as a module, a livepatch to
nested_vmx_enter_non_root_mode() doesn't seem to work because
livepatch doesn't allow KLP relocs for vmlinux symbols when they're in
a patch function originating in a module. I was able to recreate this
failure with a simple module/livepatch combo:
https://github.com/dylanbhatch/linux/tree/mod-ns-lp
Is there a way to work around this issue in the .patch source itself,
or some other way to allow these relocs?
I'll also send a reply to your V3 patch with some more details on my findings.
Thanks,
Dylan