[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=whDHsbK3HTOpTF=ue_o04onRwTEaK_ZoJp_fjbqq4+=Jw@mail.gmail.com>
Date: Fri, 21 Feb 2020 11:26:29 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Andy Lutomirski <luto@...capital.net>
Cc: Peter Zijlstra <peterz@...radead.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Jens Axboe <axboe@...nel.dk>,
Kees Cook <keescook@...omium.org>,
Jann Horn <jannh@...gle.com>, Will Deacon <will@...nel.org>
Subject: Re: [PATCH] mm/tlb: Fix use_mm() vs TLB invalidate
On Fri, Feb 21, 2020 at 11:22 AM Andy Lutomirski <luto@...capital.net> 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.
So?
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.
Linus
Powered by blists - more mailing lists