Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp111442imm; Tue, 22 May 2018 15:02:09 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpFnXmxpVmrOCinWcCT1bg/+wEOymyzrCtTvyVObxBigZjItL+SBj1gZlrffAvE1laQMkXe X-Received: by 2002:a17:902:206:: with SMTP id 6-v6mr242030plc.294.1527026529678; Tue, 22 May 2018 15:02:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527026529; cv=none; d=google.com; s=arc-20160816; b=tYYBDVHHPNtwcZvrbKSLHhwaA5mXqNE3rXZPpdLsg+RL8Njne9bbP8OM3P6mpeGhKC YHNvpNds46q8xumreQ/4cW0kkUGHYqhaAlEAyMHtrA7djZGsV1KOaghTeBtvT15Luzis gt+Gvx442xRQYiMQkKRAYvQzlAyzomzrGKqlyDokLpuK87iu/6Od1z7a96DJkG0hxICY C33pZxoUm6Rh17hT4qEcuLKnI4TM6USkDAZPNGW9dCDhwr7W/ESkoPtyWKS1l29XCn/a cIe6p53BliQe893qXGIU6jhd+TpXdzejc/OPdZvxH7ZZFm/JYtofIrCP38nv41yCkt4g DQjw== 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:dkim-signature:dkim-signature :arc-authentication-results; bh=B+HB65zSlKS+MWhalA/fx1JiaEH8vjjWkW0cbxq2Yd0=; b=ZrT9k8KQ4+Qdbw8d5mwGe/VDS0FfAwGhWY9BQYUW6yw3YpDWQ7RNkwayBY6fmXxdJG 78vuEqRoG1tv9CZudkCWWpSWrV8dZuqBfviWc5e3mR9MK1OCcLlnnwToehOp6QgBEsuz sQ7NWUZOQokoGrrTjYdAdHE4G1M5rSocDqZ+kwXThj/3hnXUg7CzfkHGOomuKmwTtA2Z JlMU2IdJ53TBRvAENsobn3yz3JY8EYoHJzbXXCtsPSz8pZPCC6SaeK91oRje3LPNREb+ rowYd7jXN6ZqvMKnZtqJk8/wZPTmVHIgRX8isBGX4QOyc5xtBeKX9grzWhBYYyI9FFl5 i7Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tobin.cc header.s=fm3 header.b=Sw58Fh5f; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=gSHd3OT9; 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 p11-v6si136984plq.192.2018.05.22.15.01.55; Tue, 22 May 2018 15:02:09 -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=@tobin.cc header.s=fm3 header.b=Sw58Fh5f; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=gSHd3OT9; 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 S1753262AbeEVWBr (ORCPT + 99 others); Tue, 22 May 2018 18:01:47 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:46303 "EHLO out3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753170AbeEVWBp (ORCPT ); Tue, 22 May 2018 18:01:45 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 1B07521511; Tue, 22 May 2018 18:01:45 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 22 May 2018 18:01:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tobin.cc; h=cc :content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=B+HB65zSlKS+MWhalA/fx1JiaEH8vjjWkW0cbxq2Yd0=; b=Sw58Fh5f hCKjQcjWg7xgpmdBQjVKPzRqNHptjpTBYxZiIrkggS7gQzOJm7RBbdpD65TrjYLH ZoXP0tm81mgt0ptZ7P6BLG8yzd+hmpG7JnlNg1hRXoiuWv8nwZl2Ytp3/0VfyA+j n0Fn36IH+7TFnGLX/jzIXL9z5etSxzjFQrwn0f9oCvfl6IH0ZHo8i4iwo/OjrktC riD4pwyUZDwkq7bkifhvad2VRc8amarQUdF11HBy4CXzE3+J3lxZJy1ATzAFbB6l u3U75AAzpXnbms5vyfxoovZvSE+bY2kpzFvQKAklKj3iU35BVjMXCnEU+dHk/V4k Xfk+J+1oB6bYxw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=B+HB65zSlKS+MWhalA/fx1JiaEH8v jjWkW0cbxq2Yd0=; b=gSHd3OT9iMhAaIkufzsAY65eS8YWD8h+xuuCegIIRcq0C Cpg3FPX88c1jw1M54AVE+lPRcTtPJ1HqT0J98hiMEgNrBw0VxzzpnVaiTYqyv56k xjm8oHuffP4ko7hrYTu3m/0F5cnHT10+Any2DNbLwNP9a1ju1GXEoDGYYw9QgQm6 gGO62QveRfWZ7tYCaJh/u5TBLfwrNrmR0xwr5RerGdE0Wg5VVFxrIv4uInZP+Rrf +pqWbfkQLCIwcUBrzTvEuF0atTZjjmAZ1SBhYWGpgvUiTig5Nj7IaK57+T9lzrye M5YGW7vOw8SnSrZVD4q8KEyn1o2woJVyXZ3QUU7eA== X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Received: from localhost (124-169-26-54.dyn.iinet.net.au [124.169.26.54]) by mail.messagingengine.com (Postfix) with ESMTPA id 2387E10252; Tue, 22 May 2018 18:01:43 -0400 (EDT) Date: Wed, 23 May 2018 08:01:40 +1000 From: "Tobin C . Harding" To: Thierry Escande Cc: Rasmus Villemoes , linux-kernel@vger.kernel.org Subject: Re: [PATCH] lib/test_printf.c: call wait_for_random_bytes() before plain %p tests Message-ID: <20180522220140.GG31095@eros> References: <20180522174114.9197-1-thierry.escande@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180522174114.9197-1-thierry.escande@linaro.org> X-Mailer: Mutt 1.5.24 (2015-08-30) User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 22, 2018 at 07:41:14PM +0200, 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 > --- > 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 Not sure if I'm qualified for this but here goes Acked-by: Tobin C. Harding thanks, Tobin.