linux/arch
Sergei Trofimovich 99e729bd40 ia64: module: fix symbolizer crash on fdescr
Noticed failure as a crash on ia64 when tried to symbolize all backtraces
collected by page_owner=on:

    $ cat /sys/kernel/debug/page_owner
    <oops>

    CPU: 1 PID: 2074 Comm: cat Not tainted 5.12.0-rc4 #226
    Hardware name: hp server rx3600, BIOS 04.03 04/08/2008
    ip is at dereference_module_function_descriptor+0x41/0x100

Crash happens at dereference_module_function_descriptor() due to
use-after-free when dereferencing ".opd" section header.

All section headers are already freed after module is laoded successfully.

To keep symbolizer working the change stores ".opd" address and size after
module is relocated to a new place and before section headers are
discarded.

To make similar errors less obscure module_finalize() now zeroes out all
variables relevant to module loading only.

Link: https://lkml.kernel.org/r/20210403074803.3309096-1-slyfox@gentoo.org
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-04-30 11:20:35 -07:00
..
alpha Kbuild updates for v5.13 2021-04-29 14:24:39 -07:00
arc
arm Networking changes for 5.13. 2021-04-29 11:57:23 -07:00
arm64 Kbuild updates for v5.13 2021-04-29 14:24:39 -07:00
csky csky: change a Kconfig symbol name to fix e1000 build error 2021-04-16 16:10:36 -07:00
h8300
hexagon
ia64 ia64: module: fix symbolizer crash on fdescr 2021-04-30 11:20:35 -07:00
m68k \n 2021-04-29 10:51:29 -07:00
microblaze Microblaze patches for 5.13-rc1 2021-04-29 11:36:47 -07:00
mips Networking changes for 5.13. 2021-04-29 11:57:23 -07:00
nds32 nds32: flush_dcache_page: use page_mapping_file to avoid races with swapoff 2021-04-09 14:54:23 -07:00
nios2
openrisc
parisc \n 2021-04-29 10:51:29 -07:00
powerpc Networking changes for 5.13. 2021-04-29 11:57:23 -07:00
riscv riscv: keep interrupts disabled for BREAKPOINT exception 2021-04-15 21:32:40 -07:00
s390 Networking changes for 5.13. 2021-04-29 11:57:23 -07:00
sh
sparc \n 2021-04-29 10:51:29 -07:00
um printk changes for 5.13 2021-04-27 18:09:44 -07:00
x86 Kbuild updates for v5.13 2021-04-29 14:24:39 -07:00
xtensa \n 2021-04-29 10:51:29 -07:00
.gitignore
Kconfig Kbuild updates for v5.13 2021-04-29 14:24:39 -07:00