* [PATCH] objtool/klp: Fix unexported static call key access for manually built livepatch modules
@ 2026-02-02 19:00 Josh Poimboeuf
2026-02-02 20:10 ` Arnd Bergmann
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Josh Poimboeuf @ 2026-02-02 19:00 UTC (permalink / raw)
To: x86; +Cc: linux-kernel, live-patching, Peter Zijlstra, Arnd Bergmann
Enabling CONFIG_MEM_ALLOC_PROFILING_DEBUG with CONFIG_SAMPLE_LIVEPATCH
results in the following error:
samples/livepatch/livepatch-shadow-fix1.o: error: objtool: static_call: can't find static_call_key symbol: __SCK__WARN_trap
This is caused an extra file->klp sanity check which was added by commit
164c9201e1da ("objtool: Add base objtool support for livepatch
modules"). That check was intended to ensure that livepatch modules
built with klp-build always have full access to their static call keys.
However, it failed to account for the fact that manually built livepatch
modules (i.e., not built with klp-build) might need access to unexported
static call keys, for which read-only access is typically allowed for
modules.
While the livepatch-shadow-fix1 module doesn't explicitly use any static
calls, it does have a memory allocation, which can cause
CONFIG_MEM_ALLOC_PROFILING_DEBUG to insert a WARN() call. And WARN() is
now an unexported static call as of commit 860238af7a33 ("x86_64/bug:
Inline the UD1").
Fix it by removing the overzealous file->klp check, restoring the
original behavior for manually built livepatch modules.
Fixes: 164c9201e1da ("objtool: Add base objtool support for livepatch modules")
Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
---
tools/objtool/check.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 933868ee3beb..ef451cd6277c 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -682,7 +682,7 @@ static int create_static_call_sections(struct objtool_file *file)
key_sym = find_symbol_by_name(file->elf, tmp);
if (!key_sym) {
- if (!opts.module || file->klp) {
+ if (!opts.module) {
ERROR("static_call: can't find static_call_key symbol: %s", tmp);
return -1;
}
--
2.52.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] objtool/klp: Fix unexported static call key access for manually built livepatch modules
2026-02-02 19:00 [PATCH] objtool/klp: Fix unexported static call key access for manually built livepatch modules Josh Poimboeuf
@ 2026-02-02 20:10 ` Arnd Bergmann
2026-02-02 21:59 ` Song Liu
2026-02-05 16:13 ` [tip: objtool/urgent] " tip-bot2 for Josh Poimboeuf
2 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2026-02-02 20:10 UTC (permalink / raw)
To: Josh Poimboeuf, x86; +Cc: linux-kernel, live-patching, Peter Zijlstra
On Mon, Feb 2, 2026, at 20:00, Josh Poimboeuf wrote:
> Enabling CONFIG_MEM_ALLOC_PROFILING_DEBUG with CONFIG_SAMPLE_LIVEPATCH
> results in the following error:
>
> samples/livepatch/livepatch-shadow-fix1.o: error: objtool:
> static_call: can't find static_call_key symbol: __SCK__WARN_trap
>
> This is caused an extra file->klp sanity check which was added by commit
> 164c9201e1da ("objtool: Add base objtool support for livepatch
> modules"). That check was intended to ensure that livepatch modules
> built with klp-build always have full access to their static call keys.
>
> However, it failed to account for the fact that manually built livepatch
> modules (i.e., not built with klp-build) might need access to unexported
> static call keys, for which read-only access is typically allowed for
> modules.
>
> While the livepatch-shadow-fix1 module doesn't explicitly use any static
> calls, it does have a memory allocation, which can cause
> CONFIG_MEM_ALLOC_PROFILING_DEBUG to insert a WARN() call. And WARN() is
> now an unexported static call as of commit 860238af7a33 ("x86_64/bug:
> Inline the UD1").
>
> Fix it by removing the overzealous file->klp check, restoring the
> original behavior for manually built livepatch modules.
>
> Fixes: 164c9201e1da ("objtool: Add base objtool support for livepatch modules")
> Reported-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Tested-by: Arnd Bergmann <arnd@arndb.de>
Thanks a lot for the fix!
Arnd
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] objtool/klp: Fix unexported static call key access for manually built livepatch modules
2026-02-02 19:00 [PATCH] objtool/klp: Fix unexported static call key access for manually built livepatch modules Josh Poimboeuf
2026-02-02 20:10 ` Arnd Bergmann
@ 2026-02-02 21:59 ` Song Liu
2026-02-05 16:13 ` [tip: objtool/urgent] " tip-bot2 for Josh Poimboeuf
2 siblings, 0 replies; 4+ messages in thread
From: Song Liu @ 2026-02-02 21:59 UTC (permalink / raw)
To: Josh Poimboeuf
Cc: x86, linux-kernel, live-patching, Peter Zijlstra, Arnd Bergmann
On Mon, Feb 2, 2026 at 11:00 AM Josh Poimboeuf <jpoimboe@kernel.org> wrote:
>
> Enabling CONFIG_MEM_ALLOC_PROFILING_DEBUG with CONFIG_SAMPLE_LIVEPATCH
> results in the following error:
>
> samples/livepatch/livepatch-shadow-fix1.o: error: objtool: static_call: can't find static_call_key symbol: __SCK__WARN_trap
>
> This is caused an extra file->klp sanity check which was added by commit
> 164c9201e1da ("objtool: Add base objtool support for livepatch
> modules"). That check was intended to ensure that livepatch modules
> built with klp-build always have full access to their static call keys.
>
> However, it failed to account for the fact that manually built livepatch
> modules (i.e., not built with klp-build) might need access to unexported
> static call keys, for which read-only access is typically allowed for
> modules.
>
> While the livepatch-shadow-fix1 module doesn't explicitly use any static
> calls, it does have a memory allocation, which can cause
> CONFIG_MEM_ALLOC_PROFILING_DEBUG to insert a WARN() call. And WARN() is
> now an unexported static call as of commit 860238af7a33 ("x86_64/bug:
> Inline the UD1").
>
> Fix it by removing the overzealous file->klp check, restoring the
> original behavior for manually built livepatch modules.
>
> Fixes: 164c9201e1da ("objtool: Add base objtool support for livepatch modules")
> Reported-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Acked-by: Song Liu <song@kernel.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [tip: objtool/urgent] objtool/klp: Fix unexported static call key access for manually built livepatch modules
2026-02-02 19:00 [PATCH] objtool/klp: Fix unexported static call key access for manually built livepatch modules Josh Poimboeuf
2026-02-02 20:10 ` Arnd Bergmann
2026-02-02 21:59 ` Song Liu
@ 2026-02-05 16:13 ` tip-bot2 for Josh Poimboeuf
2 siblings, 0 replies; 4+ messages in thread
From: tip-bot2 for Josh Poimboeuf @ 2026-02-05 16:13 UTC (permalink / raw)
To: linux-tip-commits
Cc: Arnd Bergmann, Song Liu, Josh Poimboeuf, x86, linux-kernel
The following commit has been merged into the objtool/urgent branch of tip:
Commit-ID: f495054bd12e2abe5068e243bdf344b704c303c6
Gitweb: https://git.kernel.org/tip/f495054bd12e2abe5068e243bdf344b704c303c6
Author: Josh Poimboeuf <jpoimboe@kernel.org>
AuthorDate: Mon, 02 Feb 2026 11:00:17 -08:00
Committer: Josh Poimboeuf <jpoimboe@kernel.org>
CommitterDate: Thu, 05 Feb 2026 08:00:45 -08:00
objtool/klp: Fix unexported static call key access for manually built livepatch modules
Enabling CONFIG_MEM_ALLOC_PROFILING_DEBUG with CONFIG_SAMPLE_LIVEPATCH
results in the following error:
samples/livepatch/livepatch-shadow-fix1.o: error: objtool: static_call: can't find static_call_key symbol: __SCK__WARN_trap
This is caused an extra file->klp sanity check which was added by commit
164c9201e1da ("objtool: Add base objtool support for livepatch
modules"). That check was intended to ensure that livepatch modules
built with klp-build always have full access to their static call keys.
However, it failed to account for the fact that manually built livepatch
modules (i.e., not built with klp-build) might need access to unexported
static call keys, for which read-only access is typically allowed for
modules.
While the livepatch-shadow-fix1 module doesn't explicitly use any static
calls, it does have a memory allocation, which can cause
CONFIG_MEM_ALLOC_PROFILING_DEBUG to insert a WARN() call. And WARN() is
now an unexported static call as of commit 860238af7a33 ("x86_64/bug:
Inline the UD1").
Fix it by removing the overzealous file->klp check, restoring the
original behavior for manually built livepatch modules.
Fixes: 164c9201e1da ("objtool: Add base objtool support for livepatch modules")
Reported-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Song Liu <song@kernel.org>
Tested-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/0bd3ae9a53c3d743417fe842b740a7720e2bcd1c.1770058775.git.jpoimboe@kernel.org
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
---
tools/objtool/check.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 933868e..ef451cd 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -682,7 +682,7 @@ static int create_static_call_sections(struct objtool_file *file)
key_sym = find_symbol_by_name(file->elf, tmp);
if (!key_sym) {
- if (!opts.module || file->klp) {
+ if (!opts.module) {
ERROR("static_call: can't find static_call_key symbol: %s", tmp);
return -1;
}
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-02-05 16:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-02 19:00 [PATCH] objtool/klp: Fix unexported static call key access for manually built livepatch modules Josh Poimboeuf
2026-02-02 20:10 ` Arnd Bergmann
2026-02-02 21:59 ` Song Liu
2026-02-05 16:13 ` [tip: objtool/urgent] " tip-bot2 for Josh Poimboeuf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®