Files
Centos-kernel-stream-10/kernel/livepatch
Yannick Cote 3693512d2b livepatch: Fix having __klp_objects relics in non-livepatch modules
JIRA: https://redhat.atlassian.net/browse/RHEL-152193

commit ab10815472fcbc2c772dc21a979460b7f74f0145
Author: Petr Pavlu <petr.pavlu@suse.com>
Date:   Fri Jan 23 11:26:56 2026 +0100

    livepatch: Fix having __klp_objects relics in non-livepatch modules

    The linker script scripts/module.lds.S specifies that all input
    __klp_objects sections should be consolidated into an output section of
    the same name, and start/stop symbols should be created to enable
    scripts/livepatch/init.c to locate this data.

    This start/stop pattern is not ideal for modules because the symbols are
    created even if no __klp_objects input sections are present.
    Consequently, a dummy __klp_objects section also appears in the
    resulting module. This unnecessarily pollutes non-livepatch modules.

    Instead, since modules are relocatable files, the usual method for
    locating consolidated data in a module is to read its section table.
    This approach avoids the aforementioned problem.

    The klp_modinfo already stores a copy of the entire section table with
    the final addresses. Introduce a helper function that
    scripts/livepatch/init.c can call to obtain the location of the
    __klp_objects section from this data.

    Fixes: dd590d4d57eb ("objtool/klp: Introduce klp diff subcommand for diffing object files")
    Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
    Acked-by: Joe Lawrence <joe.lawrence@redhat.com>
    Acked-by: Miroslav Benes <mbenes@suse.cz>
    Reviewed-by: Aaron Tomlin <atomlin@atomlin.com>
    Link: https://patch.msgid.link/20260123102825.3521961-2-petr.pavlu@suse.com
    Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>

Signed-off-by: Yannick Cote <ycote@redhat.com>
2026-05-12 13:54:26 +00:00
..
2026-01-07 12:55:02 -05:00