]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Apr 2024 14:35:47 +0000 (16:35 +0200)
commita2671601fa020a124fe9c7d181bf9c9faf17011a
tree685afc6f5879372c3fccd66e3dd6d56f6592a94b
parent2bc92c61c5417982e7b92ba628281f411d31013c
modpost: do not make find_tosym() return NULL

[ Upstream commit 1102f9f85bf66b1a7bd6a40afb40efbbe05dfc05 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
scripts/mod/modpost.c