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: <202504301154.1A83E92@keescook>
Date: Wed, 30 Apr 2025 11:56:09 -0700
From: Kees Cook <kees@...nel.org>
To: David Gow <davidgow@...gle.com>
Cc: Arnd Bergmann <arnd@...db.de>, Bill Wendling <morbo@...gle.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Nathan Chancellor <nathan@...nel.org>,
	Nick Desaulniers <nick.desaulniers+lkml@...il.com>,
	Justin Stitt <justinstitt@...gle.com>,
	Petr Mladek <pmladek@...e.com>, Rae Moar <rmoar@...gle.com>,
	Tamir Duberstein <tamird@...il.com>,
	Diego Vieira <diego.daniel.professional@...il.com>,
	Luis Chamberlain <mcgrof@...nel.org>, llvm@...ts.linux.dev,
	"Dr. David Alan Gilbert" <linux@...blig.org>,
	Mark Brown <broonie@...nel.org>, WangYuli <wangyuli@...ontech.com>,
	Mickaël Salaün <mic@...ikod.net>,
	Günther Noack <gnoack@...gle.com>,
	"Gustavo A. R. Silva" <gustavoars@...nel.org>,
	Paul Moore <paul@...l-moore.com>, James Morris <jmorris@...ei.org>,
	"Serge E. Hallyn" <serge@...lyn.com>, linux-kernel@...r.kernel.org,
	linux-hardening@...r.kernel.org,
	linux-security-module@...r.kernel.org
Subject: Re: [PATCH 2/3] lib/tests: Add randstruct KUnit test

On Tue, Apr 29, 2025 at 03:44:01PM +0800, David Gow wrote:
> On Sun, 27 Apr 2025 at 09:38, Kees Cook <kees@...nel.org> wrote:
> >
> > Perform basic validation about layout randomization and initialization
> > tracking when using CONFIG_RANDSTRUCT=y. Tested using:
> >
> > $ ./tools/testing/kunit/kunit.py run \
> >         --kconfig_add CONFIG_RANDSTRUCT_FULL=y \
> >         randstruct
> > [17:22:30] ================= randstruct (2 subtests) ==================
> > [17:22:30] [PASSED] randstruct_layout
> > [17:22:30] [PASSED] randstruct_initializers
> > [17:22:30] =================== [PASSED] randstruct ====================
> > [17:22:30] ============================================================
> > [17:22:30] Testing complete. Ran 2 tests: passed: 2
> > [17:22:30] Elapsed time: 5.091s total, 0.001s configuring, 4.974s building, 0.086s running
> >
> > Adding "--make_option LLVM=1" can be used to test Clang, which also
> > passes.
> >
> > Signed-off-by: Kees Cook <kees@...nel.org>
> > ---
> 
> This works here for me. I'm a little wary of the prospect of the
> "unlucky or broken" message making the test fail if we're just
> unlucky, but it seems unlikely enough that we can deal with it later
> if it ever becomes a problem.
> 
> Acked-by: David Gow <davidgow@...gle.com>

Thanks!

Yeah, I wonder if it might be an interesting adjustment to the shuffling
to make sure it isn't a no-op? Like, it would shuffle with the original
hash, and if it's a no-op, it could permute the hash again, and then try
again? Hmmm...

-- 
Kees Cook

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ