From: Tengda Wu <wutengda@huaweicloud.com>
To: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: x86@kernel.org, Andrey Ryabinin <ryabinin.a.a@gmail.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
Thomas Gleixner <tglx@linutronix.de>,
Alexander Potapenko <glider@google.com>,
Andrey Konovalov <andreyknvl@gmail.com>,
Borislav Petkov <bp@alien8.de>,
Dmitry Vyukov <dvyukov@google.com>,
Ingo Molnar <mingo@redhat.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next v2] x86: Prevent KASAN false positive warnings in __show_regs
Date: Sat, 30 Aug 2025 09:34:59 +0800 [thread overview]
Message-ID: <ac1bb376-5b16-4d06-81a2-8d15315beba2@huaweicloud.com> (raw)
In-Reply-To: <xlaeuraw7mupek3fp62o7ahp5viusp6uo36jadtuidpwwkmy6a@5pzmlcxtb2ro>
On 2025/8/30 5:01, Josh Poimboeuf wrote:
> On Fri, Aug 29, 2025 at 09:47:44AM +0000, Tengda Wu wrote:
>> static void show_regs_if_on_stack(struct stack_info *info, struct pt_regs *regs,
>> bool partial, const char *log_lvl)
>> {
>> + bool kasan_disabled = false;
>> +
>> + /*
>> + * When 'regs' resides in another task's stack space, KASAN should be
>> + * disabled to prevent false positives during 'regs->' operation, as
>> + * the 'regs' contents may change concurrently with task execution.
>> + */
>> + if (!object_is_on_stack(regs)) {
>> + kasan_disable_current();
>> + kasan_disabled = true;
>> + }
>
> I don't think this is right. object_is_on_stack() only checks current's
> *task* stack. However the regs might be on a different stack used by
> current (e.g., exception stack). In which case there's no need to
> disable KASAN.
>
> What really determines the KASAN-safety is whether it's the current task
> or not.
>
I see.
Since operations walking other tasks' regs-> only occur in show_regs_if_on_stack,
to cover a more accurate range and targets, it seems we have no choice but to add
a task parameter to show_regs_if_on_stack and then perform the check, right?
next prev parent reply other threads:[~2025-08-30 1:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-29 9:47 Tengda Wu
2025-08-29 15:36 ` Andrey Ryabinin
2025-08-29 21:01 ` Josh Poimboeuf
2025-08-30 1:34 ` Tengda Wu [this message]
2025-08-30 2:18 ` Josh Poimboeuf
2025-08-30 4:07 ` Tengda Wu
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=ac1bb376-5b16-4d06-81a2-8d15315beba2@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=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®