linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: "open list:ANDROID DRIVERS" <devel@driverdev.osuosl.org>,
	"Jann Horn" <jannh@google.com>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"Arve Hjønnevåg" <arve@android.com>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Alexander Potapenko" <glider@google.com>,
	"Joe Perches" <joe@perches.com>,
	"Dmitriy Vyukov" <dvyukov@google.com>,
	"Todd Kjos" <tkjos@google.com>
Subject: Re: [PATCH v2 2/3] binder: do not initialize locals passed to copy_from_user()
Date: Thu, 5 Mar 2020 00:26:24 -0800	[thread overview]
Message-ID: <202003050010.A1A965BF37@keescook> (raw)
In-Reply-To: <20200305080756.GB19839@kadam>

On Thu, Mar 05, 2020 at 11:07:56AM +0300, Dan Carpenter wrote:
> On Wed, Mar 04, 2020 at 10:13:40AM -0800, Kees Cook wrote:
> > On Tue, Mar 03, 2020 at 12:38:32PM +0300, Dan Carpenter wrote:
> > > The real fix is to initialize everything manually, the automated
> > > initialization is a hardenning feature which many people will disable.
> > 
> > I cannot disagree more with this sentiment. Linus has specifically said he
> > wants this initialization on by default[1],
> 
> Fine, but as long as it's a configurable thing then we need to manually
> initialize as well or it's still a CVE etc.  It will take a while before
> we drop support for old versions of GCC as well.

Yes, I agree; that's totally true. We need to continue to fix all the
uninitialized flaws we encounter unless this is on by default for all
supported compiler versions (which will be a looong time). (But it's
not relevant to this patch because copy_from_user() does already do
the initialization.)

This set of patches was about dealing with the pathological cases of
auto-init colliding with functions that do, in fact, fully init. Though
I must say, I remain concerned about inventing such markings for fear
they'll be used in places where the "trust me, it's fully initialized"
state does not actually hold[1] but the author thinks it does.

-Kees

[1] https://lore.kernel.org/netdev/1509471094.3828.26.camel@edumazet-glaptop3.roam.corp.google.com/

-- 
Kees Cook

  reply	other threads:[~2020-03-05  8:26 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-02 13:04 [PATCH v2 1/3] compiler.h: define __no_initialize glider
2020-03-02 13:04 ` [PATCH v2 2/3] binder: do not initialize locals passed to copy_from_user() glider
2020-03-02 13:09   ` Joe Perches
2020-03-02 13:25     ` Alexander Potapenko
2020-03-02 13:52       ` Dan Carpenter
2020-03-02 13:58       ` Joe Perches
2020-03-02 18:17         ` Alexander Potapenko
2020-03-02 18:31           ` Jann Horn
2020-03-05  9:03             ` Rasmus Villemoes
2020-03-05 12:45               ` Jann Horn
2020-03-06  2:29               ` Al Viro
2020-03-02 18:50           ` Joe Perches
2020-03-03  9:14             ` Alexander Potapenko
2020-03-03  9:38               ` Dan Carpenter
2020-03-03 13:56                 ` Joe Perches
2020-03-03 14:15                   ` Dan Carpenter
2020-03-04 18:13                 ` Kees Cook
2020-03-05  8:07                   ` Dan Carpenter
2020-03-05  8:26                     ` Kees Cook [this message]
2020-03-05  8:33                       ` Alexander Potapenko
2020-03-02 17:38   ` Greg KH
2020-03-02 18:28     ` Alexander Potapenko
2020-03-02 13:04 ` [PATCH v2 3/3] sched/wait: avoid double initialization in ___wait_event() glider
2020-03-02 16:56   ` Todd Kjos
2020-03-02 18:03     ` Alexander Potapenko
2020-03-02 18:39       ` Greg Kroah-Hartman

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=202003050010.A1A965BF37@keescook \
    --to=keescook@chromium.org \
    --cc=arve@android.com \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=dvyukov@google.com \
    --cc=glider@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jannh@google.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tkjos@google.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;
as well as URLs for NNTP newsgroup(s).