Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp870174imm; Wed, 13 Jun 2018 09:31:21 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIy5yZCKnQF+0HE0QxP4pDBxXRV0Ok5VNbVTndHMPu4trN3wpiOCuVmuwxyNniVzVd37nEu X-Received: by 2002:a65:5a07:: with SMTP id y7-v6mr4545950pgs.177.1528907480979; Wed, 13 Jun 2018 09:31:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528907480; cv=none; d=google.com; s=arc-20160816; b=NKTKRWo56pMEC+093axOJhTmySUlViDZ5jqGaTcG9BLLgRuWGCr7GMAopbqlQb9kdD 6q9KjTSUaJGu7M8DsR+/rl5m8StW6DwJEbFtQSGvELql+7YWpueydWNZ2XJelV5JWd5l th+7JD7IhNlHocpvKztDlMAfdYuRThQI1T/4b27hi6nhs+zrw5We1U70ZsHxM6MFsl4Q Ic1GKdAhiK4wKfRDRPXVbIdoO7l7CD9lWO6ASO3u58lf1LgACQyfWmWxQ6FQGR3Oskx5 0cf24SIaxF92Z++qo6Mud4vKCOrmTXMLLgMY5n1Vwq2rIzdblMVcIU0a+pgKzewRUAv9 NkQQ== 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=MzuxUJA/lcU8TWHfSkOpzEUCwhITPcNDYNOBMzqkdIg=; b=mlZ9rPNXWOe8JDvgCRgZXHogNugcpddyUzIIIpYNK+67fUOWxEdpv9+w7jq1feCzSE 1em/psNteX/nE88t+j5yQJG7E8ln5jybEtWZj4LlpGDX4HBILbVL+A4Rg7z70qzS/X2O AwpZjZnu7VXOGSc1dUnbatF496VquaSekSAPkFwCLTRi5/l58BwhV/bRkPOtAzC3DGFJ iJ5igfb2wb98m5AYw2WypL6gYICPo813uciMM6pdFMCb8mohcNQFozqQ/XLAkQ87lgKY vb/WVDC7dqRPx6JyvTNVNOnSTV1PVe3fEZ5FubfcCWQP4R2BegNlBLcW2jh9ivlwts8n cZhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JlA9shwl; 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 p29-v6si2657433pgd.546.2018.06.13.09.31.06; Wed, 13 Jun 2018 09:31:20 -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=JlA9shwl; 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 S934919AbeFMQaM (ORCPT + 99 others); Wed, 13 Jun 2018 12:30:12 -0400 Received: from mail-ua0-f195.google.com ([209.85.217.195]:42068 "EHLO mail-ua0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934372AbeFMQaL (ORCPT ); Wed, 13 Jun 2018 12:30:11 -0400 Received: by mail-ua0-f195.google.com with SMTP id x18-v6so2125126uaj.9 for ; Wed, 13 Jun 2018 09:30:11 -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=MzuxUJA/lcU8TWHfSkOpzEUCwhITPcNDYNOBMzqkdIg=; b=JlA9shwl9M51thqq7C4OdPGGD4omF9QDodBgN89bbA6hvutaz3+aL7tFwLMokhgC5W KlwToD15pxrY/7T5j3emyByUW35ftI0J1TLWu0hJ3rax16cTsNo8YM3FPatSMKVsnk7Q PtIHtrCeZ4YOLDw3Kj+Pn3Cri7ovS0OzEIEhYrlrbP5lE7K+Bzz/EqdJbDY7mQkZhQoA mkSlv7VVrvRIHl1urCOrFWM7+ArBe+FSfc4rKZoc9H+XMaZL3ec4KYq4GN8ZWok1ENeH QFqBdzjmIJca86m8gto7zckM7KYEj4SJO8pycGfKjhBmGwGquUll7p074PNhlQegYr6F jiUA== 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=MzuxUJA/lcU8TWHfSkOpzEUCwhITPcNDYNOBMzqkdIg=; b=JS9ZJP56YJ6L5yycnQCwkT7NOw/4pePrylQhkSP0wgRblbL+74tQ/nd7q1qbxox/do oSeKKoFGpv1L8TxhtZWtr7GNnr92vCPHkMvHDrSq8os4C5oIEDP9KA1T6UIOvdb3d6jh kQ4/laP3Jw7sk1+19j0DTsPcoAK1LGRsfsc2jPauHTinSCancM1px+fyJrBShg6S57vj jmfvCpJb7etamsFYD2UyrFk7+3KcubK8HWPIpWlIGa4EQC4g2tS/O3pTbpY5LHgT+Noc HBcq4ikbXOTMApb7x6hMmjlKzbVECOOB/VMBSO7RY+xK8Pp6/TesPfY18p1WZw3SPENn ZE+g== X-Gm-Message-State: APt69E3XDv9bmsGGHPPgQzk1bpP/Ot28Y/oc+9FDTvXisbrQQhTiJ6Vn kiajN6kD52MKvpcPdnvw/b9TSFoSSTAOJ1RGLNU= X-Received: by 2002:ab0:1b9b:: with SMTP id k27-v6mr3848973uai.122.1528907410723; Wed, 13 Jun 2018 09:30:10 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a67:8b02:0:0:0:0:0 with HTTP; Wed, 13 Jun 2018 09:30:09 -0700 (PDT) In-Reply-To: References: <20180613092919.24075-1-thierry.escande@linaro.org> From: Andy Shevchenko Date: Wed, 13 Jun 2018 19:30:09 +0300 Message-ID: Subject: Re: [PATCH v2] lib/test_printf.c: call wait_for_random_bytes() before plain %p tests To: Thierry Escande Cc: Andrew Morton , David Miller , Petr Mladek , 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 On Wed, Jun 13, 2018 at 5:59 PM, Thierry Escande wrote: > On 13/06/2018 13:22, Andy Shevchenko wrote: >> >> On Wed, Jun 13, 2018 at 12:29 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. >>> Since we cannot wait for the crng to be initialized for an undefined >>> time, both plain 'p' tests now accept the string "(ptrval)" as a valid >>> result and print a warning message. >> >> >> There are two possibilities: >> 1. (ptrval) for 32-bit case >> 2. (____ptrval____) for 64-bit case. > > > From lib/vsprintf.c, ptr_to_id() puts "(ptrval)" into the buffer, then it > gets left-padded with spaces by widen_string(). Which kernel version you are trying to fix? What I see for a long time in linux-next: static char *ptr_to_id(char *buf, char *end, void *ptr, struct printf_spec spec) { const char *str = sizeof(ptr) == 8 ? "(____ptrval____)" : "(ptrval)"; ... brought by the commit 91efafb1dd8f ("lib/vsprintf: Replace space with '_' before crng is ready"). -- With Best Regards, Andy Shevchenko