linux_dsm_epyc7002/scripts/mod
Masahiro Yamada d2e4d05cf1 modpost: fix potential segmentation fault for addend_i386_rel()
This may not be a practical problem, but the second pass of ARCH=i386
modpost causes segmentation fault if the -s option is not passed.

    MODPOST 12 modules
  Segmentation fault (core dumped)
  make[2]: *** [scripts/Makefile.modpost:94: __modpost] Error 139
  make[1]: *** [Makefile:1339: modules] Error 2
  make[1]: *** Waiting for unfinished jobs....

The segmentation fault occurs when section_rel() is called for vmlinux,
which is untested in regular builds. The cause of the problem is
reloc_location() returning a wrong pointer for ET_EXEC object type.
In this case, you need to subtract sechdr->sh_addr, otherwise it would
get access beyond the mmap'ed memory.

Add sym_get_data_by_offset() helper to avoid code duplication.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-05-29 03:08:49 +09:00
..
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
devicetable-offsets.c Char/Misc driver patches for 5.7-rc1 2020-04-03 13:22:40 -07:00
empty.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
file2alias.c Char/Misc driver patches for 5.7-rc1 2020-04-03 13:22:40 -07:00
Makefile kbuild: rename hostprogs-y/always to hostprogs/always-y 2020-02-04 01:53:07 +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 potential segmentation fault for addend_i386_rel() 2020-05-29 03:08:49 +09:00
modpost.h modpost,fixdep: Replace zero-length array with flexible-array 2020-05-26 00:03:16 +09:00
sumversion.c kbuild: remove the first line of *.mod files 2019-07-18 02:19:31 +09:00