Skip to content

KBUILD_EXTRA_SYMBOLS is needed when module dependencies exist #1238

@william-ye999

Description

@william-ye999

Is this a bug? Assume that there are two kernel modules A and B. When module A uses the symbols exported by module B, kernel module of livepatch can be created for module A because KBUILD_EXTRA_SYMBOLS has been added to the Makefile of module A.

    1. SymB is defined in module B and is exported.
    2. Module A uses SymB.
    3. KBUILD_EXTRA_SYMBOLS is added in Makefile of module A.
    4. Make a livepatch to module A.

However, if the symbol exported by module B is not used in module A but the symbol is used in the livepatch, the livepatch fails to be created even if KBUILD_EXTRA_SYMBOLS is added to the Makefile of module A.

    1. SymB is defined in module B and is exported.
    2. Module A does not use SymB.
    3. KBUILD_EXTRA_SYMBOLS is added in Makefile of module A.
    4. Make a livepatch with SymB to module A.

This is because KBUILD_EXTRA_SYMBOLS needs to be added to kmod/patch/Makefile of kpatch too. If there are many livepatches for similar situations that need to be made, the contents of the kmod/patch/Makefile need to be constantly modified. How do we solve this problem?

Note: The dependency symbols are removed from Module.symvers in commit 52c3416db00d970c91a6992ab6e5ff48e077ad29 (modpost: track if the symbol origin is a dump file or ELF object) in the Linux community.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions