]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
module: exclude SHN_UNDEF symbols from kallsyms api
authorJessica Yu <jeyu@kernel.org>
Tue, 5 Jun 2018 08:22:52 +0000 (10:22 +0200)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:51:07 +0000 (19:51 -0600)
commit7b6618f666085efa3f482f3e73fc90755d459de6
treed12f02f20372cdeb8fd357f65e70d412e37d90b1
parent3719eda69a273d4f9d48c7dfb25df4171948d031
module: exclude SHN_UNDEF symbols from kallsyms api

BugLink: https://bugs.launchpad.net/bugs/1836287
[ Upstream commit 9f2d1e68cf4d641def734adaccfc3823d3575e6c ]

Livepatch modules are special in that we preserve their entire symbol
tables in order to be able to apply relocations after module load. The
unwanted side effect of this is that undefined (SHN_UNDEF) symbols of
livepatch modules are accessible via the kallsyms api and this can
confuse symbol resolution in livepatch (klp_find_object_symbol()) and
cause subtle bugs in livepatch.

Have the module kallsyms api skip over SHN_UNDEF symbols. These symbols
are usually not available for normal modules anyway as we cut down their
symbol tables to just the core (non-undefined) symbols, so this should
really just affect livepatch modules. Note that this patch doesn't
affect the display of undefined symbols in /proc/kallsyms.

Reported-by: Josh Poimboeuf <jpoimboe@redhat.com>
Tested-by: Josh Poimboeuf <jpoimboe@redhat.com>
Reviewed-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Jessica Yu <jeyu@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
kernel/module.c