From: Andy Shevchenko <andriy.shevchenko@linux•intel.com>
To: David Laight <David.Laight@ACULAB•COM>
Cc: Petr Mladek <pmladek@suse•com>,
"linux-arch@vger•kernel.org" <linux-arch@vger•kernel.org>,
Sergey Senozhatsky <sergey.senozhatsky.work@gmail•com>,
Heiko Carstens <heiko.carstens@de•ibm.com>,
"linux-s390@vger•kernel.org" <linux-s390@vger•kernel.org>,
"linuxppc-dev@lists•ozlabs.org" <linuxppc-dev@lists•ozlabs.org>,
Rasmus Villemoes <linux@rasmusvillemoes•dk>,
"linux-kernel@vger•kernel.org" <linux-kernel@vger•kernel.org>,
Steven Rostedt <rostedt@goodmis•org>,
Michal Hocko <mhocko@suse•cz>,
Sergey Senozhatsky <sergey.senozhatsky@gmail•com>,
Stephen Rothwell <sfr@ozlabs•org>,
Linus Torvalds <torvalds@linux-foundation•org>,
Martin Schwidefsky <schwidefsky@de•ibm.com>,
"Tobin C . Harding" <me@tobin•cc>
Subject: Re: [PATCH] vsprintf: Do not break early boot with probing addresses
Date: Mon, 13 May 2019 12:13:20 +0300 [thread overview]
Message-ID: <20190513091320.GK9224@smile.fi.intel.com> (raw)
In-Reply-To: <096d6c9c17b3484484d9d9d3f3aa3a7c@AcuMS.aculab.com>
On Mon, May 13, 2019 at 08:52:41AM +0000, David Laight wrote:
> From: christophe leroy
> > Sent: 10 May 2019 18:35
> > Le 10/05/2019 à 18:24, Steven Rostedt a écrit :
> > > On Fri, 10 May 2019 10:42:13 +0200
> > > Petr Mladek <pmladek@suse•com> wrote:
> > >> - if (probe_kernel_address(ptr, byte))
> > >> + if ((unsigned long)ptr < PAGE_SIZE || IS_ERR_VALUE(ptr))
> > >> return "(efault)";
>
> "efault" looks a bit like a spellling mistake for "default".
It's a special, thus it's in parenthesis, though somebody can be
misguided.
> > Usually, < PAGE_SIZE means NULL pointer dereference (via the member of a
> > struct)
>
> Maybe the caller should pass in a short buffer so that you can return
> "(err-%d)"
> or "(null+%#x)" ?
In both cases it should be limited to the size of pointer (8 or 16
characters). Something like "(e:%4d)" would work for error codes.
The "(null)" is good enough by itself and already an established
practice..
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2019-05-13 9:16 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-09 12:19 [PATCH] vsprintf: Do not break early boot with probing addresses Petr Mladek
2019-05-09 13:05 ` Andy Shevchenko
2019-05-09 13:13 ` Steven Rostedt
2019-05-09 14:06 ` Petr Mladek
2019-05-09 13:38 ` Michal Suchánek
2019-05-09 13:46 ` David Laight
2019-05-10 10:21 ` Michael Ellerman
2019-05-10 4:32 ` Sergey Senozhatsky
2019-05-10 4:47 ` Linus Torvalds
2019-05-10 5:07 ` Sergey Senozhatsky
2019-05-10 6:41 ` Michael Ellerman
2019-05-10 8:06 ` Petr Mladek
2019-05-10 8:16 ` Sergey Senozhatsky
2019-05-10 8:42 ` Petr Mladek
2019-05-10 8:51 ` Sergey Senozhatsky
2019-05-10 14:49 ` Petr Mladek
2019-05-10 16:24 ` Steven Rostedt
2019-05-10 16:32 ` Martin Schwidefsky
2019-05-10 16:40 ` Steven Rostedt
2019-05-10 16:45 ` Martin Schwidefsky
2019-05-13 12:24 ` Petr Mladek
2019-05-10 16:41 ` Andy Shevchenko
2019-05-10 17:35 ` christophe leroy
2019-05-13 8:52 ` David Laight
2019-05-13 9:13 ` Andy Shevchenko [this message]
2019-05-13 12:42 ` Petr Mladek
2019-05-13 14:15 ` Steven Rostedt
2019-05-14 2:07 ` Sergey Senozhatsky
2019-05-14 2:25 ` Sergey Senozhatsky
2019-05-14 8:28 ` David Laight
2019-05-14 9:02 ` Geert Uytterhoeven
2019-05-14 18:37 ` Steven Rostedt
2019-05-14 19:13 ` Geert Uytterhoeven
2019-05-14 19:35 ` Steven Rostedt
2019-05-15 7:23 ` Geert Uytterhoeven
2019-05-15 7:53 ` Petr Mladek
2019-05-15 6:21 ` Sergey Senozhatsky
2019-05-15 7:35 ` Petr Mladek
2019-05-15 9:00 ` David Laight
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=20190513091320.GK9224@smile.fi.intel.com \
--to=andriy.shevchenko@linux$(echo .)intel.com \
--cc=David.Laight@ACULAB$(echo .)COM \
--cc=heiko.carstens@de$(echo .)ibm.com \
--cc=linux-arch@vger$(echo .)kernel.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-s390@vger$(echo .)kernel.org \
--cc=linux@rasmusvillemoes$(echo .)dk \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
--cc=me@tobin$(echo .)cc \
--cc=mhocko@suse$(echo .)cz \
--cc=pmladek@suse$(echo .)com \
--cc=rostedt@goodmis$(echo .)org \
--cc=schwidefsky@de$(echo .)ibm.com \
--cc=sergey.senozhatsky.work@gmail$(echo .)com \
--cc=sergey.senozhatsky@gmail$(echo .)com \
--cc=sfr@ozlabs$(echo .)org \
--cc=torvalds@linux-foundation$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox