[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180608080437.n2b5nv73d3kp6yhb@pathway.suse.cz>
Date: Fri, 8 Jun 2018 10:04:37 +0200
From: Petr Mladek <pmladek@...e.com>
To: Thierry Escande <thierry.escande@...aro.org>
Cc: 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>
Subject: Re: [PATCH RESEND] lib/test_printf.c: call wait_for_random_bytes()
before plain %p tests
On Thu 2018-06-07 20:47:25, Thierry Escande wrote:
> Hi Petr,
>
> On 07/06/2018 14:24, 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
> >
> > 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.
>
> Thanks for pointing this out.
>
> The issue is that the crng_ready() is not available outside of random.c.
> I'll leave the call to wait_for_random_bytes() if test_printf is compiled as
> a module and use add_random_ready_callback() to check if crng is initialized
> otherwise. Does that sound ok to you?
Great, I was not aware of add_random_ready_callback().
I suggest to make the decision in test_printf_init()
and run all tests either as the callback or immediately.
Best Regards,
Petr
Powered by blists - more mailing lists