Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1290549imm; Fri, 22 Jun 2018 13:54:50 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL5ga96frO9Y4C8JI/j5zygkcwpfkkBdIACA3IEFjRGIN0B2qg+Z4Mlwfpho7njG4ORINPk X-Received: by 2002:a63:2647:: with SMTP id m68-v6mr2768097pgm.9.1529700890194; Fri, 22 Jun 2018 13:54:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529700890; cv=none; d=google.com; s=arc-20160816; b=frSko2/d7AZI7e5fXIrHJUw5bQENmCwdxMif51zHCC0T0qp6fx90ztBd6Vc6rT/eZG 8G/BzsNLvzDz8oRJsDZ2fXpAdkEdaG4/LbGjLC/l1E76GJwAzdBebFF564xDAwCgkcNn YJjxGheXP86rA1bqwNyNdCSB9Xt2YHrCTBjTmvQER7HdB+3ejEx92vc8UMIvVgmXk8uD ApU3fL8mHfH6AAsHSanPuXOJYaK5xSQOkBgYxJHzk8a6+04o0NfcnVG10VPj4FMWmNwO kkj3RP1tFd7u226ZdCjIYuclESgfZJkeY1u0XeUTwIeyK3TklAjWfaVkws/3ec1PfbYx rRkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=uT9rE4HlJSxn/Z+7ZA5w4UAWZPR+nL+SDeEZ+WqFHnQ=; b=1E2FGrblRRJ9xDtbK284+lMkp9T9qMv4/rHiFcn6Mi21pOotO4J9UUMp93N5cPAjjA k3oobLNmm3svAEO1bENQj8O5iDRtrsoiyS4y9dUu2B5ue71+CNFSTF56Nyy0yVAw8O8+ f9edwbSLI7ZpNKOpV9a9YnRFUbluDolItIqJUm1ksZYd2wzIsMrAcKRJZWxZbZz5JXyb 7jSVqFzdLVVFbKKdE2rgu0BK5+Al9MoutXcf+3/Eie6MJLoTvnJCiFA6GC7OVga6XSL/ 8zJn+4TrYDA0dwbUvekW5ldckRzbqwSetfVu1k1Ku0KUp1+kc2Z5WUf+F//wXlJ5IyZG 8slw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c8-v6si2688815plr.392.2018.06.22.13.54.35; Fri, 22 Jun 2018 13:54:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933200AbeFVUxv (ORCPT + 99 others); Fri, 22 Jun 2018 16:53:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:44408 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754178AbeFVUxu (ORCPT ); Fri, 22 Jun 2018 16:53:50 -0400 Received: from home.goodmis.org (cpe-66-24-56-78.stny.res.rr.com [66.24.56.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A770A248C2; Fri, 22 Jun 2018 20:53:48 +0000 (UTC) Date: Fri, 22 Jun 2018 16:53:46 -0400 From: Steven Rostedt To: Petr Mladek Cc: Thierry Escande , Andrew Morton , David Miller , Rasmus Villemoes , "Tobin C . Harding" , linux-kernel@vger.kernel.org, Andy Shevchenko , Linus Torvalds Subject: Re: [PATCH RESEND] lib/test_printf.c: call wait_for_random_bytes() before plain %p tests Message-ID: <20180622205346.owyjk33wplzh7nhs@home.goodmis.org> References: <20180604113708.11554-1-thierry.escande@linaro.org> <20180607122434.i4x7b5ij4p6dpx7w@pathway.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180607122434.i4x7b5ij4p6dpx7w@pathway.suse.cz> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > Acked-by: Tobin C. Harding > > --- > > 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 > >