]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
modpost: do not make find_tosym() return NULL
authorMasahiro Yamada <masahiroy@kernel.org>
Sat, 23 Mar 2024 11:45:11 +0000 (20:45 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Thu, 28 Mar 2024 02:04:26 +0000 (11:04 +0900)
commit1102f9f85bf66b1a7bd6a40afb40efbbe05dfc05
treecb7d19bb1d3cd8d9380c12c07f35c0f9162a2924
parent0316e4b04e0156633df7474bae8e8b0791ce028f
modpost: do not make find_tosym() return NULL

As mentioned in commit 397586506c3d ("modpost: Add '.ltext' and
'.ltext.*' to TEXT_SECTIONS"), modpost can result in a segmentation
fault due to a NULL pointer dereference in default_mismatch_handler().

find_tosym() can return the original symbol pointer instead of NULL
if a better one is not found.

This fixes the reported segmentation fault.

Fixes: a23e7584ecf3 ("modpost: unify 'sym' and 'to' in default_mismatch_handler()")
Reported-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/mod/modpost.c