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: <20250326085343.GB25239@noisy.programming.kicks-ass.net>
Date: Wed, 26 Mar 2025 09:53:43 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Ingo Molnar <mingo@...nel.org>
Cc: linux-kernel@...r.kernel.org,
	Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH 4/5] bugs/x86: Augment warnings output by concatenating
 'cond_str' with the regular __FILE__ string in _BUG_FLAGS()

On Wed, Mar 26, 2025 at 09:47:49AM +0100, Ingo Molnar wrote:
> This allows the reuse of the UD2 based 'struct bug_entry' low-overhead
> _BUG_FLAGS() implementation and string-printing backend, without
> having to add a new field.
> 
> An example:
> 
> If we have the following WARN_ON_ONCE() in kernel/sched/core.c:
> 
> 	WARN_ON_ONCE(idx < 0 && ptr);
> 
> Then previously _BUG_FLAGS() would store this string in bug_entry::file:
> 
> 	"kernel/sched/core.c"
> 
> After this patch, it would store and print:
> 
> 	"[idx < 0 && ptr] kernel/sched/core.c"
> 
> Which is an extended string that will be printed in warnings.
> 
> Signed-off-by: Ingo Molnar <mingo@...nel.org>
> ---
>  arch/x86/include/asm/bug.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/include/asm/bug.h b/arch/x86/include/asm/bug.h
> index aff1c6b7a7f3..e966199c8ef7 100644
> --- a/arch/x86/include/asm/bug.h
> +++ b/arch/x86/include/asm/bug.h
> @@ -50,7 +50,7 @@ do {									\
>  		     "\t.org 2b+%c3\n"					\
>  		     ".popsection\n"					\
>  		     extra						\
> -		     : : "i" (__FILE__), "i" (__LINE__),		\
> +		     : : "i" (cond_str __FILE__), "i" (__LINE__),		\
>  			 "i" (flags),					\
>  			 "i" (sizeof(struct bug_entry)));		\
>  } while (0)

Sneaky :-) Do we want to touch up all the other archs? I mean, you
already touched them anyway earlier in the series in order to push this
argument through.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ