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: <aCddpaKTVTTucMX9@gmail.com>
Date: Fri, 16 May 2025 17:45:41 +0200
From: Ingo Molnar <mingo@...nel.org>
To: Alexandre Ghiti <alex@...ti.fr>
Cc: linux-kernel@...r.kernel.org,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Peter Zijlstra <peterz@...radead.org>, linux-arch@...r.kernel.org,
	Paul Walmsley <paul.walmsley@...ive.com>,
	Palmer Dabbelt <palmer@...belt.com>,
	Albert Ou <aou@...s.berkeley.edu>, linux-riscv@...ts.infradead.org
Subject: Re: [PATCH 12/15] bugs/riscv: Concatenate 'cond_str' with '__FILE__'
 in __BUG_FLAGS(), to extend WARN_ON/BUG_ON output


* Alexandre Ghiti <alex@...ti.fr> wrote:

> Hi Ingo,
> 
> On 15/05/2025 14:46, Ingo Molnar wrote:
> > Extend WARN_ON and BUG_ON style output from:
> > 
> >    WARNING: CPU: 0 PID: 0 at kernel/sched/core.c:8511 sched_init+0x20/0x410
> > 
> > to:
> > 
> >    WARNING: CPU: 0 PID: 0 at [idx < 0 && ptr] kernel/sched/core.c:8511 sched_init+0x20/0x410
> > 
> > Note that the output will be further reorganized later in this series.
> > 
> > Signed-off-by: Ingo Molnar <mingo@...nel.org>
> > Cc: Paul Walmsley <paul.walmsley@...ive.com>
> > Cc: Palmer Dabbelt <palmer@...belt.com>
> > Cc: Albert Ou <aou@...s.berkeley.edu>
> > Cc: Alexandre Ghiti <alex@...ti.fr>
> > Cc: linux-riscv@...ts.infradead.org
> > Cc: <linux-arch@...r.kernel.org>
> > ---
> >   arch/riscv/include/asm/bug.h | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/arch/riscv/include/asm/bug.h b/arch/riscv/include/asm/bug.h
> > index feaf456d465b..da9b8e83934d 100644
> > --- a/arch/riscv/include/asm/bug.h
> > +++ b/arch/riscv/include/asm/bug.h
> > @@ -61,7 +61,7 @@ do {								\
> >   			".org 2b + %3\n\t"                      \
> >   			".popsection"				\
> >   		:						\
> > -		: "i" (__FILE__), "i" (__LINE__),		\
> > +		: "i" (WARN_CONDITION_STR(cond_str) __FILE__), "i" (__LINE__),	\
> >   		  "i" (flags),					\
> >   		  "i" (sizeof(struct bug_entry)));              \
> >   } while (0)
> 
> I have added a dummy WARN_ON_ONCE(pgtable_l5_enabled == true) and I get the
> following output:
> 
> WARNING: [pgtable_l5_enabled == true] arch/riscv/kernel/setup.c:364 at
> setup_arch+0x6c4/0x704, CPU#0: swapper/0
> 
> So you can add for riscv:
> 
> Tested-by: Alexandre Ghiti <alexghiti@...osinc.com> # riscv

Thanks, I've updated the tags section of the riscv patches.

BTW., if you tried the WIP.core/bugs tree it has a final (and silly) 
WARN_ON_ONCE()-testing commit as well:

   af0503e693cf ("bugs/core: Test WARN_ON_ONCE()")

   +       WARN_ON_ONCE(ptr == 0 && 1);

:-)

Thanks,

	Ingo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ