Live Patching
 help / color / mirror / Atom feed
From: Miroslav Benes <mbenes@suse.cz>
To: Joe Lawrence <joe.lawrence@redhat.com>
Cc: live-patching@vger.kernel.org, Ben Procknow <bprockno@redhat.com>,
	 Jiri Kosina <jikos@kernel.org>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	 Petr Mladek <pmladek@suse.com>, Song Liu <song@kernel.org>
Subject: Re: [PATCH 0/1] Fix exported symbol klp-relocation bug
Date: Thu, 23 Jul 2026 11:25:25 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LSU.2.21.2607231109210.6525@pobox.suse.cz> (raw)
In-Reply-To: <20260713213128.3529250-1-joe.lawrence@redhat.com>

Hi,

> Next: symbol namespaces
> =======================
> 
> Now a harder question, I think, about symbol namespaces.  In the past,
> kpatch-build had supported patching symbols in namespace where
> MODULE_IMPORT_NS() is allowed.  Looking at kvm :: mmu.c
> ::kvm_flush_remote_tlbs(), that is annotated with
> EXPORT_SYMBOL_FOR_KVM_INTERNAL() instead.
> 
> Should we make an effort to support klp-relocations / patching to this
> use-case?
> 
> If modpost were to let klp-relocation symbols through, I *think*
> (untested) that might be enough... but it seems like that may violate
> the spirit of what the namespacing effort is trying to achieve.
> 
> Note that klp-post-link converts these symbols to SHN_LIVEPATCH before
> the module is loaded, so the kernel module loader already skips them in
> simplify_symbols() (see SHN_LIVEPATCH case).  AFAICT, the namespace
> check in modpost is the only enforcement point, and it's checking a
> symbol that will never be resolved through the normal module loading
> path anyway.

I think we will see more and more EXPORT_SYMBOL_FOR_MODULES() in the 
kernel. kvm is probably by far the most interesting one for us as of now.

Tough. All changes in upstream so far, as I remember, around reducing the 
possibility to use internal symbols for OOT modules (like kallsyms API but 
there are probably more) have been done with KLP usage in mind. Or at 
least people tried. However, there is a limit to it. If we introduce a 
workaround in upstream for this, people will definitely use it to get 
around the enforcement in their OOT modules. We should avoid that in my 
opinion.

So I would keep whatever we come up with in downstream.

Reviewed-by: Miroslav Benes <mbenes@suse.cz> for the patch. Josh has 
already taken it so just for the record.

Miroslav

  parent reply	other threads:[~2026-07-23  9:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-13 21:31 [PATCH 0/1] Fix exported symbol klp-relocation bug Joe Lawrence
2026-07-13 21:31 ` [PATCH 1/1] objtool/klp-diff: normalize Module.symvers paths to module names Joe Lawrence
2026-07-15 15:52   ` Josh Poimboeuf
2026-07-23  9:25 ` Miroslav Benes [this message]
2026-07-24  7:32   ` [PATCH 0/1] Fix exported symbol klp-relocation bug Josh Poimboeuf
2026-07-24  7:35     ` Josh Poimboeuf
2026-07-28 12:18     ` Miroslav Benes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LSU.2.21.2607231109210.6525@pobox.suse.cz \
    --to=mbenes@suse.cz \
    --cc=bprockno@redhat.com \
    --cc=jikos@kernel.org \
    --cc=joe.lawrence@redhat.com \
    --cc=jpoimboe@kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=pmladek@suse.com \
    --cc=song@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox