Re: [RFC PATCH 4/7] kconfig: support new special property shell=
From: Kees Cook
Date: Sat Feb 10 2018 - 23:14:09 EST
On Sat, Feb 10, 2018 at 12:08 PM, Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
> On Sat, Feb 10, 2018 at 11:23 AM, Kees Cook <keescook@xxxxxxxxxxxx> wrote:
>>
>> So, if this could do something like this:
>>
>> config CC_HAS_STACKPROTECTOR_STRONG
>> bool
>> option
>> shell="scripts/gcc-${ARCH}_${BITS}-has-stack-protector.sh $CC
>> $KBUILD_CPPFLAGS"
>
> Guys, this is not that important.
>
> Don't make some stupid script for stackprotector. If the user doesn't
> have a gcc that supports -fstackprotector-*, then don't show the
> options. It matters NOT ONE WHIT whether that then means that
> stackprotector will be off by default later.
What? Maybe you're misunderstanding the script? This script already exists:
$ ls scripts/gcc-x86_*
scripts/gcc-x86_32-has-stack-protector.sh
scripts/gcc-x86_64-has-stack-protector.sh
It's been there since the very beginning when Arjan added it to
validate that the compiler actually produces a stack protector when
you give it -fstack-protector. Older gccs broke this entirely, more
recent misconfigurations (as seen with some of Arnd's local gcc
builds) did similar, and there have been regressions in some versions
where gcc's x86 support flipped to the global canary instead of the
%gs-offset canary.
> Seriously. This is classic "Kees thinks that _his_ code is so
> important that everybody should get the value _he_ cares about".
I care about the kernel build informing people about what's gone wrong
as early as possible instead of producing an unbootable image that
takes forever to debug.
-Kees
--
Kees Cook
Pixel Security