Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp882920imm; Wed, 13 Jun 2018 09:43:42 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJmKoSXjgKDVZaAnkx9FRyKFtd8pc5k+kXKGHLe14eYiKvyYL17w+VdiSVxdbniNh5QX5dK X-Received: by 2002:a62:660a:: with SMTP id a10-v6mr5681478pfc.156.1528908222171; Wed, 13 Jun 2018 09:43:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528908222; cv=none; d=google.com; s=arc-20160816; b=Qelp6jFETc6euFxBO+KFCKCyIRTuvXjwBhDGt9Q5t+USeVugUtfYoMSYqMpn4cu5hN ur+cnqLDBOTKmlWI9KraUgO88xlQ5mgj3eMtieJodfJy/nrS/ifKTvU6poSjbRLd3bOo DRlBnldTnadK5to+C3WG2flUkLh2dt0Ji7GEK2loKauqnG4fjDuP9DOvJJLnXufi/l7A ZNs2Q0fPRHcmdsDkoludCaLuEmGAhMhifPXDmWHsMgne0sF9+Z5Xab6KWj1OGi6ozQtF nDN/K84XnPLZ+BTSuFOvd4bufCzyN6jYwooWPJzRd/i+BmKL0WyDrGiptwwP7JeEKNGH 4H4Q== 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=PRh79OU+UfGR0hbYKBymvBE8KyXMEFfAYLCiMgN0cvo=; b=DabWfc0mT+lEDyQWXTMXy9L+DJcuov3oWGkyQJYic8/2/Fwk44yEIPLvDLDsL2ndL/ MrizroN4CnmNBhzh1J3zR3wI6WmwaydIXYBqKpvdDSpHbiP9Ps5yxkGQCr9yiZ9sibkk DBqjH5HZeKKYLMW86m6RnVQbskszE1uF+QyiP6HntdCRngU1aSm3vsk51xh8+p3w9f3V qegrupGskEc5vyJo//CgaC2KJesLSLxlpd9RJn5H1qHoVyQtUuCdVTyI7RFDat4M7zBz cDIAzVcgwCWue57s8nr/gKJQtRBKm0Ao1XM0bURtgUeFj2Ua7xsxts7yCXi95XXd7vcl 212Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gt6S2zFo; 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 w1-v6si2619381pgp.10.2018.06.13.09.43.27; Wed, 13 Jun 2018 09:43:42 -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=gt6S2zFo; 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 S935315AbeFMQmn (ORCPT + 99 others); Wed, 13 Jun 2018 12:42:43 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:44690 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934941AbeFMQmk (ORCPT ); Wed, 13 Jun 2018 12:42:40 -0400 Received: by mail-wr0-f194.google.com with SMTP id x4-v6so3444644wro.11 for ; Wed, 13 Jun 2018 09:42:39 -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=PRh79OU+UfGR0hbYKBymvBE8KyXMEFfAYLCiMgN0cvo=; b=gt6S2zFoOatb5TwybcTH8vARw1hso4llztnkQhgpbZndK7fGmIaIh4NEAH0oNIRG9q X+nZ9etCijB5PV2Py2WFTFKfcixsQCwcsAbGM4btpGw8RSdmA1kEYBUTPnuVEHKEiLyl clysDjK72ZqWrPPzDk0iptOyBcqgFv+Vz+mU8= 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=PRh79OU+UfGR0hbYKBymvBE8KyXMEFfAYLCiMgN0cvo=; b=K/JsRKLkqgugzjOZlsqYSqZ1D3Lnn6JsazTEGw15/iYQjh1uMdfcoR8nrV49RUuuvz WzRQss9zZFK5k7IaAsKhwcXfG5i0xgoYBu2yHUuROWk7CUUOw2cE/KVNshkSKBp/ggPW D78DXn5ayaUMtUf7jnXaUcWvbOjkS7EZis61PbBLCUNMFJdZ9qhFyY8V10F86jxvRlm5 eDYzSksZyhyQ4LBezuj3lR8lkshQcbbFsvKQFLrPgQ/Qnv/YKy0naEj5xoJa0IE2Ooe6 GcJ1MqUM2BkRh3mTEXty8uKR5Wg7ARh2Gh+K6rbbXaN0GOz3JU90rwhxx+Xl4zQoKeQp HOLg== X-Gm-Message-State: APt69E1H8R3YRxZmfyzBWcVIQDgRS8DhKKdfcdSBVzZssC+tKlIeqF7P pfb+CsunnmF0NY9tUoFEH/5OricbAP8= X-Received: by 2002:adf:8e89:: with SMTP id q9-v6mr4786023wrb.269.1528908158678; Wed, 13 Jun 2018 09:42:38 -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 t17-v6sm4133599wrr.82.2018.06.13.09.42.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jun 2018 09:42:37 -0700 (PDT) Subject: Re: [PATCH v2] lib/test_printf.c: call wait_for_random_bytes() before plain %p tests To: Andy Shevchenko Cc: Andrew Morton , David Miller , Petr Mladek , Rasmus Villemoes , "Tobin C . Harding" , Linux Kernel Mailing List References: <20180613092919.24075-1-thierry.escande@linaro.org> From: Thierry Escande Message-ID: <7c23d47c-3380-f28f-bab9-fa5dcc1a93f4@linaro.org> Date: Wed, 13 Jun 2018 18:42:36 +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: 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 13/06/2018 18:30, Andy Shevchenko wrote: > 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"). I missed that one as it's not in v4.17. My bad. Regards, Thierry