Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2144227imm; Thu, 7 Jun 2018 06:12:38 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLuTnRIBQAhfllRrFzgrQKGeXHQoovqNlrYMcvoYbPZq9ysyLW1J5LNggqbmx5AdzLt7nS/ X-Received: by 2002:a62:2414:: with SMTP id r20-v6mr1783286pfj.108.1528377158695; Thu, 07 Jun 2018 06:12:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528377158; cv=none; d=google.com; s=arc-20160816; b=Lda/RZPO5Md6nh+R8ys6tLEsSLzXDkZWgZwbzcAZm7Lx7/rUzvCR5UB9yKldXWtK3n aDKjQH0ZV6Qi8dGEM1XdR+vnafnbzm3wj56P9npZFf8kYUaE+rnHd+6FbagKdkqHrsIg 5DGdYnKlPCftHVv58PEIsxPWdkrESaCI/KOFuZymmf1QeNQu/CU/DQLt7ljiq6j0E0u9 SeEBiDZNl+NIQ4G94SieygP7XteF6wF5AhAF6deh57B6hdUcH1UDkr7rg/HSGgR++CIR NdoVeaKRGZA4hgoviOJpp1Zxbn3T4epYW+ZF9eEi5YSnRHNHSv1MUOaQi36tWFMtC8Vg Y3Gg== 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=+WSs0CFbYTn9dC/lQ05iHr8KCDQHlrbnf0IKWU6h6Qw=; b=nM3fVZZJMPm4s8ArTvE83VMw1hDMRZ0MvAGrNYMb+dpND423i7V8VXVjiU6ii4W5CL 6wUvU07sevPenJm46zmfJlPznrJS7E5Es+prA/Olg5LSjV3aObAOQwnmYKt/295NVfan negT4SWqfkFOAsaYDyx5zXtMeKv4+0sLhnanhkMkksKiYu0sP6IjRHgJbtLg2mRND7A9 3O6+be5k1fJp1/M1UwCkdWz0ge2WEgqQ39C7d75jekLqGBIf5kLx5XVPtLJQGQpYt+R4 poKfFxH3sbiN5r3RqhOvbpB7fX8N3VLkXZuI8rKrbSwQZSfbNLNR4ROW3uj8V8C3l8JT RpSg== 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 u65-v6si4618016pgc.590.2018.06.07.06.12.23; Thu, 07 Jun 2018 06:12:38 -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 S1753553AbeFGMYi (ORCPT + 99 others); Thu, 7 Jun 2018 08:24:38 -0400 Received: from mx2.suse.de ([195.135.220.15]:43440 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752972AbeFGMYh (ORCPT ); Thu, 7 Jun 2018 08:24:37 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 5A6B8ABF9; Thu, 7 Jun 2018 12:24:36 +0000 (UTC) Date: Thu, 7 Jun 2018 14:24:34 +0200 From: Petr Mladek To: Thierry Escande Cc: Andrew Morton , David Miller , Rasmus Villemoes , "Tobin C . Harding" , linux-kernel@vger.kernel.org, Andy Shevchenko Subject: Re: [PATCH RESEND] lib/test_printf.c: call wait_for_random_bytes() before plain %p tests Message-ID: <20180607122434.i4x7b5ij4p6dpx7w@pathway.suse.cz> References: <20180604113708.11554-1-thierry.escande@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180604113708.11554-1-thierry.escande@linaro.org> User-Agent: NeoMutt/20170421 (1.8.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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 >