lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <372iwvlxzynnnzn42wo2kur5enrlzzcqqnx5gx6o6bnfyqqlgx@p7drg4of3sdc>
Date: Fri, 29 Aug 2025 19:18:02 -0700
From: Josh Poimboeuf <jpoimboe@...nel.org>
To: Tengda Wu <wutengda@...weicloud.com>
Cc: x86@...nel.org, Andrey Ryabinin <ryabinin.a.a@...il.com>, 
	Dave Hansen <dave.hansen@...ux.intel.com>, Thomas Gleixner <tglx@...utronix.de>, 
	Alexander Potapenko <glider@...gle.com>, Andrey Konovalov <andreyknvl@...il.com>, 
	Borislav Petkov <bp@...en8.de>, Dmitry Vyukov <dvyukov@...gle.com>, 
	Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH -next v2] x86: Prevent KASAN false positive warnings in
 __show_regs

On Sat, Aug 30, 2025 at 09:34:59AM +0800, Tengda Wu wrote:
> 
> 
> 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?

Reading another task's stack while it's running is problematic in
general -- not only for reading saved regs, but for reading any other
values on the stack.  So why not just do it in show_trace_log_lvl()?

-- 
Josh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ