From: Petr Mladek <pmladek@suse.com>
To: Harry Hsu <x90613@gmail.com>
Cc: jpoimboe@kernel.org, jikos@kernel.org, mbenes@suse.cz,
joe.lawrence@redhat.com, live-patching@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] livepatch: Fail object initialization on duplicate patched function
Date: Tue, 8 Sep 2026 09:06:35 +0200 [thread overview]
Message-ID: <ap-z-3n9BbtiV9lT@pathway> (raw)
In-Reply-To: <20260830173343.52759-2-x90613@gmail.com>
On Mon 2026-08-31 01:33:06, Harry Hsu wrote:
> Several symbols can share one address:
>
> ffffffff8ed7fef0 t __do_sys_fork
> ffffffff8ed7fef0 T __ia32_sys_fork
> ffffffff8ed7fef0 T __x64_sys_fork
>
> klp_find_ops() looks the ops up by func->old_func, i.e. by address, so
> two klp_funcs of the same livepatch naming two of these symbols resolve
> to the same klp_ops and are both pushed onto one ops->func_stack.
>
> This breaks the assumption that a single livepatch contributes at most
> one entry to any func_stack. klp_ftrace_handler() picks the entry at
> the top of the stack, but when both entries belong to the same livepatch
> there is nothing that says which of them should be used in the PATCHED
> state, and the UNPATCHED state has to end up at the original function
> either way. klp_check_stack_func() cannot tell them apart either: it
> asks whether the preceding entry is the original function or another
> livepatch's replacement, and an aliased sibling is neither.
>
> Patching two aliases of one function from a single livepatch was never
> meaningful, so fail object initialization in klp_init_object_loaded()
> rather than leave the redirection undefined.
>
> Fixes: 3c33f5b99d68 ("livepatch: support for repatching a function")
> Suggested-by: Petr Mladek <pmladek@suse.com>
> Signed-off-by: Harry Hsu <x90613@gmail.com>
Looks good to me and passes selftests:
Reviewed-by: Petr Mladek <pmladek@suse.com>
Tested-by: Petr Mladek <pmladek@suse.com>
Best Regards,
Petr
next prev parent reply other threads:[~2026-09-08 7:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-30 17:33 [PATCH v3 0/3] " Harry Hsu
2026-08-30 17:33 ` [PATCH 1/3] " Harry Hsu
2026-09-08 7:06 ` Petr Mladek [this message]
2026-08-30 17:33 ` [PATCH 2/3] livepatch: Move code for updating livepatch object relocations Harry Hsu
2026-08-30 17:33 ` [PATCH 3/3] livepatch: Clean up klp_init_object_loaded() when fails Harry Hsu
2026-08-30 17:56 ` sashiko-bot
2026-08-31 12:57 ` Petr Mladek
2026-09-05 15:55 ` [PATCH] selftests/livepatch: Test rejection of aliased symbols in one object Harry Hsu
2026-09-08 7:09 ` Petr Mladek
2026-09-08 20:39 ` Song Liu
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=ap-z-3n9BbtiV9lT@pathway \
--to=pmladek@suse.com \
--cc=jikos@kernel.org \
--cc=joe.lawrence@redhat.com \
--cc=jpoimboe@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=live-patching@vger.kernel.org \
--cc=mbenes@suse.cz \
--cc=x90613@gmail.com \
/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
all inboxes | Powered by JetHome®