Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1333748imm; Fri, 22 Jun 2018 14:51:44 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIFhYSxBDXFk1tS/seyjrGPdpIlT+vi6NlIVtlPxa7GBkNBvZb1qKWcPB6uGzecp/mZx0Tc X-Received: by 2002:a17:902:968c:: with SMTP id n12-v6mr3248199plp.15.1529704303985; Fri, 22 Jun 2018 14:51:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529704303; cv=none; d=google.com; s=arc-20160816; b=0LCQ86Pmcld/YOxAQUAQvSU49aTYoDQhg3BGLXcZU1hcjA+PAggKkxJNHeX1XNi7KV EPiBRQ0fNCPMdkikzaWcS+TVbcbCRfY7DQIqm1cgvztv1bWR7XS3Vr2w8plUNHY9N8Kz ietdKwVSnnTUgdJB3oB23KoTWZl7oBVytXFiMdMAkwvINVeEXaWrRgtK4X+1qXac+71U zP0cvlGzgy/E8xj6ujdhKrNfpc5xxsG5I1M60ihSgm5Djya4hhNCTm75yr/Iv7RQuYLQ 8ZHxIBCP2Uw98lIuvRG6chIfCf+LVZFPvBOrXlYgB2DFTNvcNE0ZB/NWXGu8g7iiJEw7 QiUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=nb7gwKEi7wrpa7ryLvokYFq5D6MvbLRy1x109eWHhsY=; b=AEP/DxG52ch2T796KdnC9Mcs6TkekqFFyUdqv07thn8aJBTjWziS/xO4PSu2M4WYmb Myy/5PimOrCxUPdM/SLoGysam/vfUpP86OjHx8mxUDO6qzWlGGxR/X2TaViThZhaL80e 2JQBC/DZMqPnBwrsvs9/1OSLBfl+HZXmwBFCLkbYgFApIXmouBz7psQ4MUHM65jKRYcs Uv8LsPUAi6mY/UwitQbaqWVWExK4tVRoxJ6z+Tl4nmhB5k3KidLadvNXA6LiD7itiMyZ w4mkWKvRTwSKGmASEPvjzh3nqnEQGCZgoh+eJ017Eam4/gUdEj8YfdWms4R/qinA2FsW dxrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GUAdZZNJ; 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 i69-v6si6971037pge.674.2018.06.22.14.51.29; Fri, 22 Jun 2018 14:51:43 -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=GUAdZZNJ; 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 S933807AbeFVVuZ (ORCPT + 99 others); Fri, 22 Jun 2018 17:50:25 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:39370 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754265AbeFVVuY (ORCPT ); Fri, 22 Jun 2018 17:50:24 -0400 Received: by mail-wm0-f65.google.com with SMTP id p11-v6so4063640wmc.4 for ; Fri, 22 Jun 2018 14:50:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=nb7gwKEi7wrpa7ryLvokYFq5D6MvbLRy1x109eWHhsY=; b=GUAdZZNJJRLY3aRrgJZQBky+6mpxd+7XWH3qzlaq33cpFIQofYQ89XBBuc2CHOMjIt tO4dCsYPy3A4vRSQaxIG5/X7pgEk5ytiMPjDR6Rgm3r2dk2nN8Z2SQjCMLFqX/Bu4p/h kGMPgFAPgCeiefIyA+4ti2yG9MCt8Hkbr6BpM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=nb7gwKEi7wrpa7ryLvokYFq5D6MvbLRy1x109eWHhsY=; b=HkUu2gOywBDVQFBJfAY8btkqkM38ZyMtdONRfIEduPctDrgbYjhyZHFqMra9mmajaN qE4ZQupq5psUlCXw0mlacT/8o9XRzQX1pcx7zucW8DyToyBc50soK5At3E7g4tqV//9R V9exFWwldbbSOdkWrC4lApjW4m8ArdpEnX+QNZVEOLktTHwvfiSiwycHjn8IanQtO7TH /+irxaP8MY3+Rpn3EyC9xaFZc26pfjaqdFFdYIjLOyEh3jZOn4Y1VvQdA7mtNqrdehw0 5lIxMf3RVkwTULhB711OlLFMP3b5BFMPBv7bKQ7jVwEXnCbft66fi+8HQtr7KRueILMj wNRg== X-Gm-Message-State: APt69E0xlo2ImO0VeaA+Hgq/64Ek73AAJ+ZiCuzE6VyB0Go5jwZaKueV hlMm0SLD3+PLBOEjP137NX8/jBKnNP8= X-Received: by 2002:a1c:e6d4:: with SMTP id e81-v6mr2684818wmi.152.1529704222779; Fri, 22 Jun 2018 14:50:22 -0700 (PDT) Received: from [192.168.1.100] (aig34-1-88-167-228-121.fbx.proxad.net. [88.167.228.121]) by smtp.gmail.com with ESMTPSA id b190-v6sm3387848wma.24.2018.06.22.14.50.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jun 2018 14:50:21 -0700 (PDT) Subject: Re: [PATCH RESEND] lib/test_printf.c: call wait_for_random_bytes() before plain %p tests To: Steven Rostedt , Petr Mladek Cc: Andrew Morton , David Miller , Rasmus Villemoes , "Tobin C . Harding" , linux-kernel@vger.kernel.org, Andy Shevchenko , Linus Torvalds References: <20180604113708.11554-1-thierry.escande@linaro.org> <20180607122434.i4x7b5ij4p6dpx7w@pathway.suse.cz> <20180622205346.owyjk33wplzh7nhs@home.goodmis.org> From: Thierry Escande Message-ID: Date: Fri, 22 Jun 2018 23:50:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180622205346.owyjk33wplzh7nhs@home.goodmis.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22/06/2018 22:53, Steven Rostedt wrote: > 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. This patch has been superseded with a v2 and a v3 pushed into Petr printk.git tree (https://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk.git/commit/?h=for-4.19&id=ce041c43f22298485122bab15c14d062383fbc67). Sorry for the mess... Regards, Thierry > > -- 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 >>>