mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zheng Yejian <zhengyejian@huaweicloud.com>
To: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: peterz@infradead.org, tglx@linutronix.de, mingo@redhat.com,
	bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com,
	brgerst@gmail.com, samitolvanen@google.com, kees@kernel.org,
	x86@kernel.org, linux-kernel@vger.kernel.org,
	Ye Weihua <yeweihua4@huawei.com>
Subject: Re: [PATCH] x86/unwind/orc: Fix unwind for newly forked tasks
Date: Fri, 11 Oct 2024 14:50:32 +0800	[thread overview]
Message-ID: <afae0e1f-7033-858c-ea5d-2b4a5383e9c6@huaweicloud.com> (raw)
In-Reply-To: <20240913231108.a3ukhoyhp2xactdq@treble>

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@huaweicloud.com>
> 
> Thanks!
> 
> Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
> 

Hi, Josh, thanks for your ack!
Will this patch go into mainline soon?

-- 
Thanks,
Zheng Yejian


  reply	other threads:[~2024-10-11  6:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-13  2:45 Zheng Yejian
2024-09-13 23:11 ` Josh Poimboeuf
2024-10-11  6:50   ` Zheng Yejian [this message]
2024-10-11 15:39     ` Josh Poimboeuf
2024-10-12  7:34       ` Zheng Yejian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=afae0e1f-7033-858c-ea5d-2b4a5383e9c6@huaweicloud.com \
    --to=zhengyejian@huaweicloud.com \
    --cc=bp@alien8.de \
    --cc=brgerst@gmail.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jpoimboe@kernel.org \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=samitolvanen@google.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=yeweihua4@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®