summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorZheng Yejian <zhengyejian@huaweicloud.com>2024-09-13 10:45:01 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-12-09 10:31:50 +0100
commit8d91bdca2f97fa7a195b7a5f7552ffb6d259dda5 (patch)
treeda56983b6d8c8fe36e4a083c1f8b67f7cde45553 /kernel
parentcc08c2c8e98e84756530f3aa1c1d5c1439a6e305 (diff)
downloadlinux-8d91bdca2f97fa7a195b7a5f7552ffb6d259dda5.tar.gz
linux-8d91bdca2f97fa7a195b7a5f7552ffb6d259dda5.tar.bz2
linux-8d91bdca2f97fa7a195b7a5f7552ffb6d259dda5.zip
x86/unwind/orc: Fix unwind for newly forked tasks
[ Upstream commit 3bf19a0fb690022ec22ce87a5afeb1030cbcb56c ] 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 3aec4ecb3d1f ("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: 3aec4ecb3d1f ("x86: Rewrite ret_from_fork() in C") Signed-off-by: Zheng Yejian <zhengyejian@huaweicloud.com> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions