Re: [PATCH] selftests/livepatch: Test rejection of aliased symbols in one object

From: Song Liu

Date: Tue Sep 08 2026 - 16:51:36 EST


On Sat, Sep 5, 2026 at 8:55 AM Harry Hsu <x90613@xxxxxxxxx> wrote:
>
> klp_init_object_loaded() now rejects an object whose klp_funcs resolve to
> the same address, because aliased symbols would push two klp_funcs of one
> livepatch onto a single ops->func_stack and leave the redirection
> ambiguous.
>
> Add a target module providing test_klp_alias_show() together with its
> __alias() sibling, and a livepatch naming both of them. Two test cases
> cover both callers of klp_init_object_loaded(): the klp_enable_patch()
> path, where the target module is loaded before the livepatch, and the
> klp_module_coming() path, where the livepatch is loaded first and the
> module loader has to refuse the target module.
>
> Suggested-by: Song Liu <song@xxxxxxxxxx>
> Signed-off-by: Harry Hsu <x90613@xxxxxxxxx>

LGTM. Thanks for adding the test!

Acked-by: Song Liu <song@xxxxxxxxxx>