]> asedeno.scripts.mit.edu Git - linux.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)
committerJessica Yu <jeyu@kernel.org>
Mon, 18 Jun 2018 08:04:03 +0000 (10:04 +0200)
commit9f2d1e68cf4d641def734adaccfc3823d3575e6c
tree8febb7c0433318d4fb69ccbf0f5147ca766028c5
parentce397d215ccd07b8ae3f71db689aedb85d56ab40
module: exclude SHN_UNDEF symbols from kallsyms api

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>
kernel/module.c