archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <>
To: Andy Lutomirski <>
Cc: Peter Zijlstra <>,
	Andrew Morton <>,
	Linux Kernel Mailing List <>,
	Jens Axboe <>, Kees Cook <>,
	Jann Horn <>, Will Deacon <>
Subject: Re: [PATCH] mm/tlb: Fix use_mm() vs TLB invalidate
Date: Fri, 21 Feb 2020 11:26:29 -0800	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Fri, Feb 21, 2020 at 11:22 AM Andy Lutomirski <> wrote:
> 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.


IF this ever triggers, it has presumably been around for decades.

Nobody noticed.

Adding a WARN_ON_ONCE() means that somebody will now notice. Good.

Adding a BUG_ON() will now possibly mean that the machine is dead, and
is not sending the bug-report to anybody.

It's not going to hit, of course. But if you are 100% sure of that,
then it shouldn't exist at all.

And if you're not 100% sure of it, then it's going to be in some very
unusual circumstances (possibly some odd driver subsystem that does
something completely wrong - wouldn't be the first time), and the last
thing you want to do is lose the information about it.

So BUG_ON() is basically ALWAYS 100% the wrong thing to do. The
argument that "there could be memory corruption" is complete and utter
garbage. See above why.

Stop it. Seriously.


  reply	other threads:[~2020-02-21 19:26 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
2020-02-21 19:26     ` Linus Torvalds [this message]
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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='' \ \ \ \ \ \ \ \ \ \

* 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;
as well as URLs for NNTP newsgroup(s).