LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Ilya Dryomov <idryomov@gmail.com>,
Steven Rostedt <rostedt@goodmis.org>,
Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Jonathan Corbet <corbet@lwn.net>,
Kees Cook <keescook@chromium.org>,
"Tobin C . Harding" <me@tobin.cc>,
Linus Torvalds <torvalds@linux-foundation.org>,
Linux Documentation List <linux-doc@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] vsprintf: sanely handle NULL passed to %pe
Date: Mon, 24 Feb 2020 10:55:01 +0100 [thread overview]
Message-ID: <20200224095501.ds7pbjwj2izmcvus@pathway.suse.cz> (raw)
In-Reply-To: <cec0c65b-5b5d-6268-dae0-1d4088baab76@rasmusvillemoes.dk>
On Sat 2020-02-22 00:52:27, Rasmus Villemoes wrote:
> On 21/02/2020 14.05, Petr Mladek wrote:
> > On Thu 2020-02-20 16:02:48, Ilya Dryomov wrote:
>
> >> I would like to see it in 5.6, so that it is backported to 5.4 and 5.5.
> >
> Sorry to be that guy, but yes, I'm against changing the behavior of
> vsnprintf() without at least some test(s) added to the test suite - the
> lack of machine-checked documentation in the form of tests is what led
> to that regression in the first place.
I would not call this regression. It was intentional. The change in
5.2 unified the behavior for the other %p? modifiers. I simply did
not care about plain %p because it was already crippled by the hashing.
I am fine with the proposed change. But the more I think about it
the less I want to rush it in for 5.6. The proposed patch changes
the behavior again:
Value Output v5.1 Output v5.2 Proposal
NULL (null) 00000000<.hash.> 0000000000000000
fffffffffffffffe 00000000<.hash.> 00000000<.hash.> fffffffffffffffe
ffffffff12345678 00000000<.hash.> 00000000<.hash.> 00000000<.hash.>
I do not want to change this in rc phase. I would really like to wait
for 5.7.
> But I agree that there's no point adding another helper function and
> muddying the test suite even more (especially as the name error_pointer
> is too close to the name errptr() I chose a few months back for the %pe).
>
> So how about
>
> - remove the now stale test_hashed("%p", NULL); from null_pointer()
> - add tests of "%p", NULL and "%p", ERR_PTR(-123) to plain()
>
> and we save testing the "%px" case for when we figure out a good name
> for a helper for that (explicit_pointer? pointer_as_hex?)
In this, case I would prefer to fix the tests properly first. There
have been only few commits in lib/test_printf.c since 5.2. And they
should not conflict with the changes proposed at
https://lkml.kernel.org/r/20200220125707.hbcox3xgevpezq4l@pathway.suse.cz
So it should be easy to backport as well.
If you want, I could sent the cleanup patch properly for review.
Best Regards,
Petr
next prev parent reply other threads:[~2020-02-24 9:55 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-17 22:28 [PATCH] vsprintf: don't obfuscate NULL and error pointers Ilya Dryomov
2020-02-17 23:47 ` Kees Cook
2020-02-18 0:07 ` Ilya Dryomov
2020-02-18 10:33 ` Petr Mladek
2020-02-18 11:16 ` Ilya Dryomov
2020-02-18 16:50 ` Steven Rostedt
2020-02-19 2:13 ` Sergey Senozhatsky
2020-02-18 18:49 ` Linus Torvalds
2020-02-18 19:31 ` Adam Borowski
2020-02-18 19:38 ` Linus Torvalds
2020-02-18 20:19 ` Ilya Dryomov
2020-02-18 20:21 ` Linus Torvalds
2020-02-19 7:30 ` Rasmus Villemoes
2020-02-19 8:21 ` [PATCH] vsprintf: sanely handle NULL passed to %pe Rasmus Villemoes
2020-02-19 9:35 ` Andy Shevchenko
2020-02-19 11:20 ` Ilya Dryomov
2020-02-19 11:25 ` Andy Shevchenko
2020-02-19 11:29 ` Ilya Dryomov
2020-02-19 11:53 ` Rasmus Villemoes
2020-02-19 13:48 ` Petr Mladek
2020-02-19 13:56 ` Rasmus Villemoes
2020-02-19 14:45 ` Petr Mladek
2020-02-19 15:38 ` Andy Shevchenko
2020-02-19 15:40 ` Rasmus Villemoes
2020-02-19 17:23 ` Ilya Dryomov
2020-02-20 12:57 ` Petr Mladek
2020-02-20 15:02 ` Ilya Dryomov
2020-02-21 13:05 ` Petr Mladek
2020-02-21 23:52 ` Rasmus Villemoes
2020-02-22 8:14 ` Andy Shevchenko
2020-02-24 9:55 ` Petr Mladek [this message]
2020-02-18 18:44 ` [PATCH] vsprintf: don't obfuscate NULL and error pointers Linus Torvalds
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200224095501.ds7pbjwj2izmcvus@pathway.suse.cz \
--to=pmladek@suse.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=corbet@lwn.net \
--cc=idryomov@gmail.com \
--cc=keescook@chromium.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=me@tobin.cc \
--cc=rostedt@goodmis.org \
--cc=sergey.senozhatsky@gmail.com \
--cc=torvalds@linux-foundation.org \
--subject='Re: [PATCH] vsprintf: sanely handle NULL passed to %pe' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).