Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3493537imm; Mon, 4 Jun 2018 04:39:27 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL6YrSkQe9j8p4eg/3N3RGCwdJW3dxd9rR3qDzjIJE+BSvL742B0lXHlaQ0QAv0zupL2LMm X-Received: by 2002:a17:902:758e:: with SMTP id j14-v6mr9903926pll.160.1528112367754; Mon, 04 Jun 2018 04:39:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528112367; cv=none; d=google.com; s=arc-20160816; b=pHVy4EfO7HBh5z8p4cbOZ2qPyHd+u+dLhnwOT5K/WNw71Zp9PVT6CQt0wUJaNbE6Gx kKZQxpGNx+wkfgWG53kBmB48odT6mWbi6wDeG6kodiaGeT1cqO20D5/Qgi3IbpfFnVt4 zpdwIsmsK6NN+rK83MamRraX/d4inbbEinvCJfE+aSz3yBbkA1BPHoimlrcOr49rp0Jf wDDvQ+gl+LK3R2JJEAfsrbbyIR8CoBhuFON87HfbAzrKuMPp82y6acHDcxqzf9gzSt2M u6ogcS3W0sboc4ERZMbQU1m+pa0V1tAYOdvJtEHrkfeESG1HyEHWIA2ffXQLZLzME1c/ LbNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfert-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=+q1BN5jZsK5WD8MUn005XbYY/U4efa+o60xifL0bS1Q=; b=k/W8wKtcQ8zVqERmRe5rKOiaTTO9IuMy7uRy5vM/iiXGTj/7sG9TUwLdUOVs0sFfOv Fc4MzPCSOSDEiQtEqftf1lzhR6nTH55MygI5kx8twYCOaPnx/TnJZGmh3Ec1WJp4CMFf ptyYkkI7xjwxtrMrPFRCg1hB+F6XbEOCJX9A622+ErW7SkmdCCPzGPPgbjeJ8SlflzLN 8rfeE1ZHtMR5s1vqSJtfJGwHMr+5jfUG8PnTqy7mIo1KErXA2WkWGmXKJHW8Bjv+X2cy 6eRzykvUl0smfpRYzhlK2vDdHNVBNm+Cr9/9WjrBj1c3fou/oSl7nb51KE2fF+8/w11q v1Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ggNzyAje; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e3-v6si35938214pga.487.2018.06.04.04.39.13; Mon, 04 Jun 2018 04:39:27 -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=@linaro.org header.s=google header.b=ggNzyAje; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752192AbeFDLhR (ORCPT + 99 others); Mon, 4 Jun 2018 07:37:17 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:36125 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751418AbeFDLhQ (ORCPT ); Mon, 4 Jun 2018 07:37:16 -0400 Received: by mail-wm0-f68.google.com with SMTP id v131-v6so14197218wma.1 for ; Mon, 04 Jun 2018 04:37:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfert-encoding; bh=+q1BN5jZsK5WD8MUn005XbYY/U4efa+o60xifL0bS1Q=; b=ggNzyAjeRl3Rr4HkQjmejmVPzmoBeNt+chUO5FJ/JovOqk5BZfQICVV2oTJQ9lxb3L efPyI7c9+wqQSOpcFegKCLB0OjyatjJnQTT1OA1rT0P1jjCpZZuSbkc/1iNDfaWPPJ6I 7nQL2nIK1O4PlyjH2K4Q8yD8DEM7CsT1lXkL8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfert-encoding; bh=+q1BN5jZsK5WD8MUn005XbYY/U4efa+o60xifL0bS1Q=; b=TaDCrpf/ljWowr5B2eC3TScEDKR4ie2KVbTnA6Qc06ABEKEdsUiiUiPdqKn9jhJezL 9i8wmzDoX65HQPkv6xVwXTQNAMAyMvrO8VeBmYpDeOeMqyj+TRt9Jq+E5GRA0xm8lAKk yeXNoULtuqvmX8UPSi00TzkqzzJcERGaWwTvxx2gJtlimOldju+NV1AYdciRy+XT23gK 6thsxtBw9b31497qHZYp5cBkHJ92rvu8z+LuYf2+/W92gSs/Emgqm1umAYZ1/pWJoycA autt8ff02nZXxKPHLvQtfonlvhQhzbVcoiuBnFMYvRnI+vk4/AJmWzpJbrV9+1LotqyO EENQ== X-Gm-Message-State: APt69E1jZRCUPjJIL3o4AVjmr7ZW5Gdv7r17MXBTbDcgSQYvLN6GI1TK VpLVTrWNhxHgh9Eac3lO44J2gHCyOk0= X-Received: by 2002:a1c:d2cb:: with SMTP id j194-v6mr1425802wmg.129.1528112235550; Mon, 04 Jun 2018 04:37:15 -0700 (PDT) Received: from localhost.localdomain (aig34-1-88-167-228-121.fbx.proxad.net. [88.167.228.121]) by smtp.gmail.com with ESMTPSA id g16-v6sm13959983wro.86.2018.06.04.04.37.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Jun 2018 04:37:14 -0700 (PDT) From: Thierry Escande To: Andrew Morton , David Miller Cc: Rasmus Villemoes , "Tobin C . Harding" , linux-kernel@vger.kernel.org Subject: [PATCH RESEND] lib/test_printf.c: call wait_for_random_bytes() before plain %p tests Date: Mon, 4 Jun 2018 13:37:08 +0200 Message-Id: <20180604113708.11554-1-thierry.escande@linaro.org> X-Mailer: git-send-email 2.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset = "utf-8" Content-Transfert-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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