[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3754e1b2-598e-b3dc-7aa5-942e1c0feb94@huaweicloud.com>
Date: Sat, 12 Oct 2024 15:34:53 +0800
From: Zheng Yejian <zhengyejian@...weicloud.com>
To: Josh Poimboeuf <jpoimboe@...nel.org>
Cc: peterz@...radead.org, tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
dave.hansen@...ux.intel.com, hpa@...or.com, brgerst@...il.com,
samitolvanen@...gle.com, kees@...nel.org, x86@...nel.org,
linux-kernel@...r.kernel.org, Ye Weihua <yeweihua4@...wei.com>
Subject: Re: [PATCH] x86/unwind/orc: Fix unwind for newly forked tasks
On 2024/10/11 23:39, Josh Poimboeuf wrote:
> On Fri, Oct 11, 2024 at 02:50:32PM +0800, Zheng Yejian wrote:
>> On 2024/9/14 07:11, Josh Poimboeuf wrote:
>>> On Fri, Sep 13, 2024 at 10:45:01AM +0800, Zheng Yejian wrote:
>>>> 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@...weicloud.com>
>>>
>>> Thanks!
>>>
>>> Acked-by: Josh Poimboeuf <jpoimboe@...nel.org>
>>>
>>
>> Hi, Josh, thanks for your ack!
>> Will this patch go into mainline soon?
>
> Sorry about that, I'll go ahead and queue this up.
>
Thanks!
Zheng Yejian
Powered by blists - more mailing lists