public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Petr Mladek <pmladek@suse.com>
Cc: Jane Chu <jane.chu@oracle.com>,
	"rostedt@goodmis.org" <rostedt@goodmis.org>,
	"senozhatsky@chromium.org" <senozhatsky@chromium.org>,
	"linux@rasmusvillemoes.dk" <linux@rasmusvillemoes.dk>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	Haakon Bugge <haakon.bugge@oracle.com>,
	John Haxby <john.haxby@oracle.com>
Subject: Re: [PATCH] vsprintf: protect kernel from panic due to non-canonical pointer dereference
Date: Thu, 20 Oct 2022 16:57:22 +0300	[thread overview]
Message-ID: <Y1FTwpngS5EPgSX4@smile.fi.intel.com> (raw)
In-Reply-To: <Y1D8RfpkyLa4FU7r@alley>

On Thu, Oct 20, 2022 at 09:44:05AM +0200, Petr Mladek wrote:
> On Tue 2022-10-18 23:49:27, Andy Shevchenko wrote:
> > On Tue, Oct 18, 2022 at 08:30:01PM +0000, Jane Chu wrote:

...

> > Obviously, to see the crash. And let kernel _to crash_. Isn't it what we need
> > to see a bug as early as possible?
> 
> I do not agree here. Kernel tries to survive many situations when
> thighs does not work as expected. It prints a warning so that
> users/developers are aware of the problem and could fix it.

How the user will know what the root cause and how to fix it? The crash
report will give all needed information, the "(eXXXXXX)" will hide it all,
which I consider inappropriate approach.

I.o.w. consider "(eXXXXXX)" vs. something like "your stuff crashed kernel
because of misaligned / etc pointer which has value of 0xXXXXXXXX and other
registers have these values" and so on, so on...

> In our case, the crash happened when reading a sysfs file.
> IMHO, it is much better to show (-EINVAL) than crash. The bug
> when accessing devX_attrY[] does not affect the stability of
> the system at all.

When I got "eXXXXX" from cat /sys/... I think "OK, something went wrong,
I shouldn't really take it seriously". And completely different feelings
when you got a crash, right?

> And the broken string might be passed in a very rare case,
> e.g. in an error path. So that it might be hard to catch
> when testing.

-- 
With Best Regards,
Andy Shevchenko




      parent reply	other threads:[~2022-10-20 13:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20221017191611.2577466-1-jane.chu@oracle.com>
     [not found] ` <Y02sENwhtpsx5yhP@smile.fi.intel.com>
     [not found]   ` <5d987403-a7bf-8996-d639-c99edeaabcdf@oracle.com>
     [not found]     ` <Y06f4EwisLTU0rEz@alley>
2022-10-18 18:56       ` [PATCH] vsprintf: protect kernel from panic due to non-canonical pointer dereference Jane Chu
2022-10-18 19:28         ` Randy Dunlap
2022-10-18 19:58           ` Jane Chu
2022-10-18 20:07         ` Andy Shevchenko
2022-10-18 20:30           ` Jane Chu
2022-10-18 20:49             ` Andy Shevchenko
2022-10-19 10:43               ` Haakon Bugge
2022-10-19 11:25                 ` Andy Shevchenko
2022-10-19 18:36               ` Jane Chu
2022-10-19 19:26                 ` Andy Shevchenko
2022-10-19 20:16                   ` Jane Chu
2022-10-20  7:44               ` Petr Mladek
2022-10-20  9:18                 ` Petr Mladek
2022-10-20 13:57                 ` Andy Shevchenko [this message]

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=Y1FTwpngS5EPgSX4@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=haakon.bugge@oracle.com \
    --cc=jane.chu@oracle.com \
    --cc=john.haxby@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.org \
    /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
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