mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tengda Wu <wutengda@huaweicloud.com>
To: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	x86@kernel.org, Thomas Gleixner <tglx@linutronix.de>,
	Alexander Potapenko <glider@google.com>,
	Andrey Konovalov <andreyknvl@gmail.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH -next] x86: Prevent KASAN false positive warnings in __show_regs()
Date: Fri, 29 Aug 2025 17:45:10 +0800	[thread overview]
Message-ID: <3ee1aeb7-bd3a-4d6e-a446-2390de0ce561@huaweicloud.com> (raw)
In-Reply-To: <r3gkmgetikfsuggva42qnfxzx3pdiy3vtl25fepfvvacvrzyjz@xmgcvxuquary>



On 2025/8/29 3:16, Josh Poimboeuf wrote:
> On Thu, Aug 28, 2025 at 08:06:17PM +0800, Tengda Wu wrote:
>> +++ b/arch/x86/kernel/dumpstack.c
>> @@ -189,9 +189,15 @@ static void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
>>         unsigned long visit_mask = 0;
>>         int graph_idx = 0;
>>         bool partial = false;
>> +       bool kasan_disabled = false;
>>  
>>         printk("%sCall Trace:\n", log_lvl);
>>  
>> +       if (task != current) {
>> +               kasan_disable_current();
>> +               kasan_disabled = true;
>> +       }
> 
> Looks reasonable to me, though note that some callers pass a NULL @task
> to indicate 'current'.
> 
> (No idea why, that subtlety should probably be removed...)
> 
> So this might need to be
> 
> 	if (task && task != current) {
> 		...
> 

Dave mentioned that there's an object_is_on_stack available, which is
essentially on_current_stack. I will try using it and send out v2.

Thanks,
Tengda


      reply	other threads:[~2025-08-29  9:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-18 13:07 Tengda Wu
2025-08-20 21:36 ` Dave Hansen
2025-08-21  3:13   ` Tengda Wu
2025-08-27 11:58     ` Tengda Wu
2025-08-27 14:36 ` Dave Hansen
2025-08-28 12:04   ` Tengda Wu
2025-08-27 14:45 ` Andrey Ryabinin
2025-08-28 12:06   ` Tengda Wu
2025-08-28 14:13     ` Dave Hansen
2025-08-29  2:50       ` Tengda Wu
2025-08-28 19:16     ` Josh Poimboeuf
2025-08-29  9:45       ` Tengda Wu [this message]

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=3ee1aeb7-bd3a-4d6e-a446-2390de0ce561@huaweicloud.com \
    --to=wutengda@huaweicloud.com \
    --cc=andreyknvl@gmail.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=dvyukov@google.com \
    --cc=glider@google.com \
    --cc=jpoimboe@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=ryabinin.a.a@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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®