[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9bd50ce2-0ac8-a5dc-a584-0610891c7805@bytedance.com>
Date: Sat, 8 Apr 2023 13:26:25 +0800
From: Qi Zheng <zhengqi.arch@...edance.com>
To: Josh Poimboeuf <jpoimboe@...nel.org>
Cc: peterz@...radead.org, keescook@...omium.org,
dave.hansen@...ux.intel.com, bp@...en8.de, mingo@...hat.com,
tglx@...utronix.de, rostedt@...dmis.org, x86@...nel.org,
linux-kernel@...r.kernel.org,
Chen Zhongjin <chenzhongjin@...wei.com>,
Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH 1/2] x86: make profile_pc() use arch_stack_walk()
On 2023/4/8 12:56, Josh Poimboeuf wrote:
> On Thu, Mar 30, 2023 at 04:15:51PM +0800, Qi Zheng wrote:
>> The profile_pc() try to get pc by doing a trick to read
>> the contents of the stack. This may cause false positives
>> for KASAN, like the following:
>>
>> BUG: KASAN: stack-out-of-bounds in profile_pc+0x5b/0x90
>> Read of size 8 at addr ffff8881062a7a00 by task id/130040
>
> I don't think this was actually a false positive. The !FRAME_POINTER
> code in profile_pc() has been badly broken for many years.
>
> BTW, there was a similar patch here:
>
> https://lore.kernel.org/lkml/20230224021858.120078-1-chenzhongjin@huawei.com/
Ah.
>
> I thought CONFIG_PROFILING was obsolete but Andi said previously he
> wants to keep it for at least boot-time profiling.
>
> Andi did suggest removing the lock profiling hacks, which means all the
> profile_pc() implementations can just be removed in favor of the generic
> instruction_pointer().
That's great, and I see Chen Zhongjin will send a new patch for this,
let him continue this work. :)
>
--
Thanks,
Qi
Powered by blists - more mailing lists