linux/scripts/mod
Max Kellermann 23dfd914d2 modpost: fix null pointer dereference
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>
2024-03-19 02:30:03 +09:00
..
.gitignore .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
devicetable-offsets.c Staging driver updates for 6.7-rc1 2023-11-03 15:31:04 -10:00
empty.c
file2alias.c Kbuild updates for v6.7 2023-11-04 08:07:19 -10:00
list.h modpost: import include/linux/list.h 2022-05-08 03:17:00 +09:00
Makefile modpost: Optimize symbol search from linear to binary search 2023-10-03 20:25:59 +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-03-19 02:30:03 +09:00
modpost.h modpost: avoid using the alias attribute 2024-01-31 23:24:27 +09:00
sumversion.c modpost: trim leading spaces when processing source files list 2024-02-15 06:57:19 +09:00
symsearch.c modpost: Optimize symbol search from linear to binary search 2023-10-03 20:25:59 +09:00