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

On Fri, Feb 21, 2020 at 3:10 PM Kees Cook <> wrote:
> Why not just fail after the WARN -- I wrote the patch for the (very few)
> callers to handle the errors, clean up, and carry on.

Can it actually fail? Or is this all just "let's add new error
conditions that make the code harder to read because they make no
actual sense"?

It's not clear that it's worth handling "cannot happen" situations. It
might be worth warning about them (that's questionable too, but at
least there's an argument that you "verify that it can't happen").

But having the error condition of a "cannot happen" situation then
percolate down and make other code more complex seems to be only a

It's not even security or "avoid data corruption" at that point. At
the point where you start adding more complexity for things that
aren't supposed to be possible in the first place, you're only going
to cause bugs.

Maybe not immediately. But "illegible code" ends up being "buggy code"
a decade later.


  reply	other threads:[~2020-02-21 23:57 UTC|newest]

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

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).