All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <kees@outflux.net>
To: Andi Kleen <ak@linux.intel.com>
Cc: Randy Dunlap <rdunlap@infradead.org>,
	akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	linux-next@vger.kernel.org, sfr@canb.auug.org.au, mhocko@suse.cz
Subject: Re: mmotm 2014-07-02-15-07 uploaded (stack protector)
Date: Wed, 2 Jul 2014 18:13:05 -0700	[thread overview]
Message-ID: <20140703011305.GK5412@outflux.net> (raw)
In-Reply-To: <20140703010019.GS19781@tassilo.jf.intel.com>

On Wed, Jul 02, 2014 at 06:00:19PM -0700, Andi Kleen wrote:
> > The problem is that if you make kbuild hard-fail when selecting this missing
> > compiler option, you can never switch it back because "make menuconfig" will
> > refuse to build since the compiler option would be missing. Being silent
> > about the missing option (and/or falling back to other options) means that
> > you could get two different kernel features selection with the same CONFIG_*
> > set, depending on the kernel, which is extremely bad ("I selected
> > stack-protector-strong but it built without it?!").
> 
> The assumption that every flag in a .config has been consciouscly 
> selected by a human is a quite dubious one ...

Sure; it was actually via automated config updates that I uncovered this
limitation of kbuild in the first place.

> LTO just turns itself off if the toolchain doesn't support it.

For this situation, it is more surprising to have this option fall back,
since it is a security feature selection. The build must fail in some way if
compiler doesn't match CONFIG.

> > So, the middle ground was to warn about it during the kbuild logic so
> > you could find the source of the problem, but ultimately fail the build
> > when the compiler doesn't support it so there weren't any silent failure
> > modes.
> 
> Longer term it would be of course best to move all the cc-options
> probing into Kconfig. I bet that would speed up builds too.

Absolutely. I presently lack the deep knowledge to figure this out. :)

-Kees

-- 
Kees Cook                                            @outflux.net

  reply	other threads:[~2014-07-03  1:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-02 22:08 mmotm 2014-07-02-15-07 uploaded akpm
2014-07-02 22:08 ` akpm
2014-07-02 23:21 ` mmotm 2014-07-02-15-07 uploaded (stack protector) Randy Dunlap
2014-07-03  0:22   ` Andi Kleen
2014-07-03  0:37     ` Randy Dunlap
2014-07-03  0:51     ` Kees Cook
2014-07-03  0:56       ` Andrew Morton
2014-07-03  1:10         ` [PATCH] kbuild: explain stack-protector-strong CONFIG logic Kees Cook
2014-07-03  1:00       ` mmotm 2014-07-02-15-07 uploaded (stack protector) Andi Kleen
2014-07-03  1:13         ` Kees Cook [this message]
2014-07-03  0:57   ` Kees Cook
2014-07-03  1:42     ` Randy Dunlap

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=20140703011305.GK5412@outflux.net \
    --to=kees@outflux.net \
    --cc=ak@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=mhocko@suse.cz \
    --cc=rdunlap@infradead.org \
    --cc=sfr@canb.auug.org.au \
    /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.