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]
Date:   Fri, 22 Jun 2018 16:53:46 -0400
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Petr Mladek <pmladek@...e.com>
Cc:     Thierry Escande <thierry.escande@...aro.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        David Miller <davem@...emloft.net>,
        Rasmus Villemoes <linux@...musvillemoes.dk>,
        "Tobin C . Harding" <me@...in.cc>, linux-kernel@...r.kernel.org,
        Andy Shevchenko <andy.shevchenko@...il.com>,
        Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH RESEND] lib/test_printf.c: call wait_for_random_bytes()
 before plain %p tests

On Thu, Jun 07, 2018 at 02:24:34PM +0200, Petr Mladek wrote:
> On Mon 2018-06-04 13:37:08, Thierry Escande wrote:
> > If the test_printf module is loaded before the crng is initialized, the
> > plain 'p' tests will fail because the printed address will not be hashed
> > and the buffer will contain '(ptrval)' instead.
> > This patch adds a call to wait_for_random_bytes() before plain 'p' tests
> > to make sure the crng is initialized.
> 
> Hmm, my system did not boot with this patch and
> CONFIG_TEST_PRINTF=y

And neither does my test box. It killed my tests I was running, as one of the
configs I test has this set.

It appears that Andrew pulled it in and sent it to Linus, as it is in
4.18-rc1, and I need to now revert this patch to make my tests work.

-- Steve


> 
> I guess that there was not enough entropy. It is basically a deadlock.
> The build-in module init calls are called when SMP is enabled but
> there is no real activity and the init calls are called sequentially.
> Therefore there is nothing that could produce some entropy, ...
> 
> I suggest to skip the test when crng is not ready.
> 
> Best Regards,
> Petr
> 
> > Signed-off-by: Thierry Escande <thierry.escande@...aro.org>
> > Acked-by: Tobin C. Harding <me@...in.cc>
> > ---
> >  lib/test_printf.c | 7 +++++++
> >  1 file changed, 7 insertions(+)
> > 
> > diff --git a/lib/test_printf.c b/lib/test_printf.c
> > index 71ebfa43ad05..839be9385a8a 100644
> > --- a/lib/test_printf.c
> > +++ b/lib/test_printf.c
> > @@ -260,6 +260,13 @@ plain(void)
> >  {
> >  	int err;
> >  
> > +	/*
> > +	 * Make sure crng is ready. Otherwise we get "(ptrval)" instead
> > +	 * of a hashed address when printing '%p' in plain_hash() and
> > +	 * plain_format().
> > +	 */
> > +	wait_for_random_bytes();
> > +
> >  	err = plain_hash();
> >  	if (err) {
> >  		pr_warn("plain 'p' does not appear to be hashed\n");
> > -- 
> > 2.14.1
> > 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ