lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VeiH+FvT7pbCpx75kxxeC5huxKRtXQvzfVjX4OyCaLLrw@mail.gmail.com>
Date:   Wed, 13 Jun 2018 19:30:09 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Thierry Escande <thierry.escande@...aro.org>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        David Miller <davem@...emloft.net>,
        Petr Mladek <pmladek@...e.com>,
        Rasmus Villemoes <linux@...musvillemoes.dk>,
        "Tobin C . Harding" <me@...in.cc>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] lib/test_printf.c: call wait_for_random_bytes() before
 plain %p tests

On Wed, Jun 13, 2018 at 5:59 PM, Thierry Escande
<thierry.escande@...aro.org> wrote:
> On 13/06/2018 13:22, Andy Shevchenko wrote:
>>
>> On Wed, Jun 13, 2018 at 12:29 PM, Thierry Escande
>> <thierry.escande@...aro.org> 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ