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] [day] [month] [year] [list]
Message-ID: <20250702211243.GA327934@ax162>
Date: Wed, 2 Jul 2025 14:12:43 -0700
From: Nathan Chancellor <nathan@...nel.org>
To: Bill Wendling <morbo@...gle.com>
Cc: Kees Cook <kees@...nel.org>, Jann Horn <jannh@...gle.com>,
	Jannik Glückert <jannik.glueckert@...il.com>,
	linux-hardening@...r.kernel.org,
	Nick Desaulniers <nick.desaulniers+lkml@...il.com>,
	Justin Stitt <justinstitt@...gle.com>, linux-kernel@...r.kernel.org,
	llvm@...ts.linux.dev
Subject: Re: [PATCH] kunit/fortify: Add back "volatile" for sizeof() constants

On Tue, Jul 01, 2025 at 10:38:36AM -0700, Bill Wendling wrote:
> On Tue, Jul 1, 2025 at 9:27 AM Kees Cook <kees@...nel.org> wrote:
> > I have not had the time to minimize it, no.

I can try to extract this into a minimal reproducer next week if nothing
major crops up over the long weekend.

> OPTIMIZER_HIDE_VAR doesn't have a 'volatile' on it. Could that be it?

I tested

diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 6f04a1d8c720..eab208a9a6f4 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -160,7 +160,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
 #ifndef OPTIMIZER_HIDE_VAR
 /* Make the optimizer believe the variable can be manipulated arbitrarily. */
 #define OPTIMIZER_HIDE_VAR(var)						\
-	__asm__ ("" : "=r" (var) : "0" (var))
+	__asm__ volatile("" : "=r" (var) : "0" (var))
 #endif
 
 #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)

but that did not resolve the error.

Cheers,
Nathan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ