mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Minchan Kim <minchan@kernel.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
	linux-kernel@vger.kernel.org,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Subject: Re: [PATCH] zsmalloc: calling zs_map_object() from irq is a bug
Date: Tue, 26 Sep 2017 17:26:32 -0700	[thread overview]
Message-ID: <20170926172632.cf302deff749d12f74d8a4da@linux-foundation.org> (raw)
In-Reply-To: <20170920064739.GA11000@bbox>

On Wed, 20 Sep 2017 15:47:39 +0900 Minchan Kim <minchan@kernel.org> wrote:

> On Wed, Sep 20, 2017 at 03:39:41PM +0900, Sergey Senozhatsky wrote:
> > Use BUG_ON(in_interrupt()) in zs_map_object(). Calling this
> > function from IRQ is a bug, because we use per-CPU mappings
> > and interrupt may corrupt those buffers.
> > 
> > Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> 
> IMHO, corruption the buffer would be not enough to be a BUG_ON
> which stop the system fully so user loses any chances to shut
> down smooth/hunt it down.
> 
> More serious thing of our case is that it can leak other user's
> data by overwriting, which is more concern I am thinking now.
> 

In an off-list email Linus has basically stated that all new uses of
BUG_ON should include words in the changelog or code comments
explaining why it is justifiable to kill the machine when the condition
triggers.

So can we please have a v2 with the appropriate comment?

  parent reply	other threads:[~2017-09-27  0:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-20  6:39 Sergey Senozhatsky
2017-09-20  6:47 ` Minchan Kim
2017-09-20  6:48   ` Sergey Senozhatsky
2017-09-27  0:26   ` Andrew Morton [this message]
2017-09-28  0:41     ` Sergey Senozhatsky
2017-09-29  4:51 Sergey Senozhatsky

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=20170926172632.cf302deff749d12f74d8a4da@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minchan@kernel.org \
    --cc=sergey.senozhatsky.work@gmail.com \
    --cc=sergey.senozhatsky@gmail.com \
    /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

Powered by JetHome