OpenCloudOS-Kernel/scripts/mod
Max Kellermann 19e525ebbb modpost: fix null pointer dereference
[ Upstream commit 23dfd914d2bfc4c9938b0084dffd7105de231d98 ]

If the find_fromsym() call fails and returns NULL, the warn() call
will dereference this NULL pointer and cause the program to crash.

This happened when I tried to build with "test_user_copy" module.
With this fix, it prints lots of warnings like this:

 WARNING: modpost: lib/test_user_copy: section mismatch in reference: (unknown)+0x4 (section: .text.fixup) -> (unknown) (section: .init.text)

masahiroy@kernel.org:
 The issue is reproduced with ARCH=arm allnoconfig + CONFIG_MODULES=y +
 CONFIG_RUNTIME_TESTING_MENU=y + CONFIG_TEST_USER_COPY=m

Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-13 13:07:39 +02:00
..
.gitignore .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
Makefile modpost: Optimize symbol search from linear to binary search 2024-04-10 16:35:47 +02:00
devicetable-offsets.c vfio/cdx: add support for CDX bus 2023-06-16 12:27:04 -06:00
empty.c
file2alias.c modpost: fix ishtp MODULE_DEVICE_TABLE built on big-endian host 2023-11-20 11:59:28 +01:00
list.h modpost: import include/linux/list.h 2022-05-08 03:17:00 +09:00
mk_elfconfig.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
modpost.c modpost: fix null pointer dereference 2024-04-13 13:07:39 +02:00
modpost.h modpost: Optimize symbol search from linear to binary search 2024-04-10 16:35:47 +02:00
sumversion.c modpost: trim leading spaces when processing source files list 2024-02-23 09:24:59 +01:00
symsearch.c modpost: Optimize symbol search from linear to binary search 2024-04-10 16:35:47 +02:00