Re: [PATCH 03/14] objtool/klp: Fix false module dependencies caused by dead relocs

Dylan Hatch <[email protected]>
Newsgroups org.kernel.vger.linux-modules,org.kernel.vger.linux-kernel,org.kernel.vger.live-patching
Message-ID <CADBMgpyY6R_YmEqhZSw=88-Bfkv9=s-N-x1siE1uPAgH_fTURw@mail.gmail.com>
Hi Josh,

On Wed, Aug 12, 2026 at 1:27 PM Josh Poimboeuf <[email protected]> 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@kernel.org

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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.