All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Lutomirski <luto@amacapital.net>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Jens Axboe <axboe@kernel.dk>, Kees Cook <keescook@chromium.org>,
	Jann Horn <jannh@google.com>, Will Deacon <will@kernel.org>
Subject: Re: [PATCH] mm/tlb: Fix use_mm() vs TLB invalidate
Date: Fri, 21 Feb 2020 11:22:16 -0800	[thread overview]
Message-ID: <6A09F721-0AD9-4B86-AB3E-563A1CF5ABDE@amacapital.net> (raw)
In-Reply-To: <CAHk-=wi4uO+Djqr4Jc1TnCofwxUTuXHtgkgwnVX86q06UGV6DA@mail.gmail.com>



> On Feb 21, 2020, at 11:19 AM, Linus Torvalds <torvalds@linux-foundation.org> wrote:
> 
> On Fri, Feb 21, 2020 at 3:11 AM Peter Zijlstra <peterz@infradead.org> wrote:
>> 
>> +       BUG_ON(!(tsk->flags & PF_KTHREAD));
>> +       BUG_ON(tsk->mm != NULL);
> 
> Stop this craziness.
> 
> There is absolutely ZERO excuse for this kind of garbage.
> 
> Making this a BUG_ON() will just cause all the possible debugging info
> to be thrown away and lost, and you often have a dead machine.
> 
> For absolutely no good reason.
> 
> Make it a WARN_ON_ONCE(). If it triggers, everything works the way it
> always did, but we get notified.
> 
> Stop with the stupid crazy BUG_ON() crap already. It is actively _bad_
> for debugging.
> 
>  

In this particular case, if we actually flub this, we are very likely to cause data corruption — we’re about to do user access with the wrong mm.

So I suppose we could switch to init_mm and carry on. *Something* will crash, but it probably won’t corrupt data or take down the machine.

  reply	other threads:[~2020-02-21 19:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-21 11:11 [PATCH] mm/tlb: Fix use_mm() vs TLB invalidate Peter Zijlstra
2020-02-21 19:19 ` Linus Torvalds
2020-02-21 19:22   ` Andy Lutomirski [this message]
2020-02-21 19:26     ` Linus Torvalds
2020-02-21 23:10     ` Kees Cook
2020-02-21 23:57       ` Linus Torvalds
2020-02-22  0:29         ` Kees Cook

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=6A09F721-0AD9-4B86-AB3E-563A1CF5ABDE@amacapital.net \
    --to=luto@amacapital.net \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=jannh@google.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=torvalds@linux-foundation.org \
    --cc=will@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.