linux/arch
Zheng Yejian 3bf19a0fb6 x86/unwind/orc: Fix unwind for newly forked tasks
When arch_stack_walk_reliable() is called to unwind for newly forked
tasks, the return value is negative which means the call stack is
unreliable. This obviously does not meet expectations.

The root cause is that after commit 3aec4ecb3d ("x86: Rewrite
 ret_from_fork() in C"), the 'ret_addr' of newly forked task is changed
to 'ret_from_fork_asm' (see copy_thread()), then at the start of the
unwind, it is incorrectly interprets not as a "signal" one because
'ret_from_fork' is still used to determine the initial "signal" (see
__unwind_start()). Then the address gets incorrectly decremented in the
call to orc_find() (see unwind_next_frame()) and resulting in the
incorrect ORC data.

To fix it, check 'ret_from_fork_asm' rather than 'ret_from_fork' in
__unwind_start().

Fixes: 3aec4ecb3d ("x86: Rewrite ret_from_fork() in C")
Signed-off-by: Zheng Yejian <zhengyejian@huaweicloud.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
2024-10-17 15:13:07 -07:00
..
alpha move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
arc move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
arm move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
arm64 ARM64: 2024-10-06 10:53:28 -07:00
csky mm: make arch_get_unmapped_area() take vm_flags by default 2024-09-09 16:39:13 -07:00
hexagon hexagon: vdso: Fix build failure 2024-09-23 08:17:50 -07:00
loongarch move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
m68k m68knommu: updates and fixes for v6.12 2024-09-24 10:48:44 -07:00
microblaze move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
mips move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
nios2 move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
openrisc
parisc move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
powerpc powerpc/8xx: Fix kernel DTLB miss on dcbz 2024-10-11 15:53:06 +11:00
riscv riscv: Fix kernel stack size when KASAN is enabled 2024-10-01 13:08:11 -07:00
s390 fs/proc/kcore.c: allow translation of physical memory addresses 2024-10-09 12:47:19 -07:00
sh move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
sparc move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
um move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
x86 x86/unwind/orc: Fix unwind for newly forked tasks 2024-10-17 15:13:07 -07:00
xtensa move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
.gitignore
Kconfig cfi: encode cfi normalized integers + kasan/gcov bug in Kconfig 2024-09-26 21:27:27 +02:00