Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp860890imm; Tue, 5 Jun 2018 05:45:02 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKPnnQ135rRiITEJL97tYyFV+fXQul1NmLHKNxWO5gY0AzvUftCVUpQeOUmz+Y/Wmf35hCH X-Received: by 2002:a63:b812:: with SMTP id p18-v6mr6828786pge.11.1528202702115; Tue, 05 Jun 2018 05:45:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528202702; cv=none; d=google.com; s=arc-20160816; b=BUdFYkoLhLvQWtvsHlM8zI/y0hGk9drIoWZfvQ0F0oPVARzaLxW4KN36EQfZQWGIJR Q6m+PuDDSnmxNXiWhCKwDpNlY2VulIAKNHB7SfPe+CP+cQ657yvS+5WrGflz7M+RRmmM vA3hPT5Y9mULGoYig9qUn470sKMlAFjh9ixhBtsHPU1Er0VAzWpFhCrIgZ5I71KQRz/q Fd8rGIU/bOV14sIwj54BLu8XWNzwpirNSU8RUe7dvQL+3OVeip7pIU9lpMKpqGx4+lMu i+9Zt0ZYz3TFk2JupRhYmeE1d39yjNjacCJMXpMYvzpQlJGOhkBdaewHFOWMyb83OSfO gIFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=rhszMFxiyMfjWIaq6vmblBGDLo28Mr0Fw52lZrTdnaI=; b=pIhaxoetcEKiYzl3/qc+TrkD4SWeBdbJisX8rzWzZtXqpwwrwtgmMgiJRY4zmom31/ w2dHaBMDcdVj0U4swN65Ycq7i4FmiUTALjJvpH1z5wlUcOmvmhvtljDXCfEXr0nOYEeV 5VFRwEcBPC5E57VuJCe9dROkmrDPQt7gXV/e6vRsyC5TfZAt+9TMiXmffiYP+JC9hKwc 98UCfZFV5tEpmkC2z7ROcdPWZ9dzKBGXu7ruCTab+PVFB4utwLwPDZpSZom6TcIvmDgh pPE4zDkERyqO0oDHh5JxPiLFnsL5GInHkebfW1p/8Qo1/erWnfNw1t7kXnaokKzMLRYv bKZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XlWWYqpk; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g15-v6si28182974plq.242.2018.06.05.05.44.47; Tue, 05 Jun 2018 05:45:02 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XlWWYqpk; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751849AbeFEMnY (ORCPT + 99 others); Tue, 5 Jun 2018 08:43:24 -0400 Received: from mail-qk0-f195.google.com ([209.85.220.195]:39493 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751622AbeFEMnX (ORCPT ); Tue, 5 Jun 2018 08:43:23 -0400 Received: by mail-qk0-f195.google.com with SMTP id g14-v6so1357818qkm.6 for ; Tue, 05 Jun 2018 05:43:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=rhszMFxiyMfjWIaq6vmblBGDLo28Mr0Fw52lZrTdnaI=; b=XlWWYqpkJ2/xHC+Rw3b+C9uA5oe2ccfdWTwrInr22BIpNj+XEpW8fPE3R97MI9KUoZ WgsEJjddWvtcOINGItKMHzvnJKyV+GicjSk7JGqLQMPZ6bFW0CnkvCMuxlmLLRrtlkA8 MlW7l0S39ssKNk4F+slyX3zoebb1yfFvS3WZGhbqFPyjw5ePT2woxC9f3UZv6lV4u9hj N7i8r05AOnh+eGaVgaWgaB6m27OG8f4S4KNdglweK6GGTuHLK587DcxTqpq3sk7Zbicc 1COUNCwjctQUc2ogC9TNlNaJmyUq1Uh5RF0YAkYRlVpFMeVhAEggRZ1tliB+GHmNFaKO 1L6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=rhszMFxiyMfjWIaq6vmblBGDLo28Mr0Fw52lZrTdnaI=; b=TDZLGqG9ZMcryd0p/BK6U1ssLhZO/s/QE3dHkCK9YWpi3XAoREb21ZuDK9iDnJ9afu VoiEYwpHlR1a+Y1RXmXuKS34e2P3YslXBemViejlA6I7qpMvqltdsuaey46o8gvq+e4T 1oY4S9dx7TvXVG4uvoNSafuEKhOmqA/ua/12HjKjlpaMy2JrtkDRxgkVGi0rroWCDJb+ oVruxVVhnKG6rJquGigtz3UXRWGH7r5VdFW7I7DhxW5e7UIHmVxUtm54JK4Pxur3uqJi cp7XS+5TmbIy/E3b1vBiWLzPqLN0NJ2YBCoRAbj877WrTKrTIzhBpvck2157tRsVVxRt bv/A== X-Gm-Message-State: APt69E0+OAScehb0gFbB+mSAuYELfipclKZ3kW1dabK6SpcJfKdmKx2n cYptDbDIadN3rXCr4Cp6tkTqAfsoTZ9tuuAuV3g= X-Received: by 2002:a37:d1d0:: with SMTP id o77-v6mr20835798qkl.185.1528202602885; Tue, 05 Jun 2018 05:43:22 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a0c:98f9:0:0:0:0:0 with HTTP; Tue, 5 Jun 2018 05:43:22 -0700 (PDT) In-Reply-To: <20180604113708.11554-1-thierry.escande@linaro.org> References: <20180604113708.11554-1-thierry.escande@linaro.org> From: Andy Shevchenko Date: Tue, 5 Jun 2018 15:43:22 +0300 Message-ID: Subject: Re: [PATCH RESEND] lib/test_printf.c: call wait_for_random_bytes() before plain %p tests To: Thierry Escande , Petr Mladek Cc: Andrew Morton , David Miller , Rasmus Villemoes , "Tobin C . Harding" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +Cc: Petr. I suppose test_printf is going through his tree as well as vsnprintf itself. At least it logically makes sense. On Mon, Jun 4, 2018 at 2:37 PM, 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. > > 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 > -- With Best Regards, Andy Shevchenko