lkml.org 
[lkml]   [2014]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: mmotm 2014-07-02-15-07 uploaded (stack protector)
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


\
 
 \ /
  Last update: 2014-07-03 03:21    [W:0.056 / U:0.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site