From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] Stack protector choices [was: [PATCH v2, 2/2] lxc: fix build without stack protector]
Date: Tue, 4 Dec 2018 11:08:54 +0100 [thread overview]
Message-ID: <20181204110854.17685bf4@windsurf> (raw)
In-Reply-To: <42790e46-35a7-299a-cbae-4b83383287a3@mind.be>
Hello,
On Tue, 4 Dec 2018 10:35:05 +0100, Arnout Vandecappelle wrote:
> If you look at it from a practical point of view, we can only do option (1), or
> "we sometimes enforce the system-level configuration options, but not
> consistently". Indeed, if a package does the stack protector detection
> correctly, chances are we'll never even notice that it enables stack protector.
I was going to say that the checksec tool could help us detect such
situations (i.e SSP is disabled at the Buildroot level, but some
binaries end up being built with SSP). However, it seems like checksec
is not checking SSP support, but PIE, RELRO and a few other things.
> So in practice, I think the policy should be (as it is for other policy
> options, e.g. debug):
>
> 1. If there is no configuration option for it, let the package decide.
>
> 2. If there is a configuration option that does the same as our option, disable
> it and let the toolchain wrapper apply the correct option.
>
> 3. If there is a configuration option and it does something more, enable it
> automatically based on the global Buildroot option.
>
> 4. In very exceptional cases where (3) is even more invasive, offer an option to
> the user (but only if the toolchain supports it, of course).
>
> An example of (3) would be the kernel's stack protector which is a little more
> than just -fstack-protector so it needs to be enabled explicitly. An example of
> (4) would be -fsanitize=address vs. KASAN - KASAN is a way more invasive
> operation than gcc's address sanitizer. Note that specifically for the kernel,
> we of course always do (4) - kernel config is provided separately. But the
> kernel is just an easy example that everybody knows.
OK, works for me. Should we write this down somewhere ?
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2018-12-04 10:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-03 22:38 [Buildroot] [PATCH v2,1/2] lxc: fix missing include for va_list Fabrice Fontaine
2018-12-03 22:38 ` [Buildroot] [PATCH v2,2/2] lxc: fix build without stack protector Fabrice Fontaine
2018-12-04 5:54 ` [Buildroot] [PATCH v2, 2/2] " Baruch Siach
2018-12-04 8:10 ` Thomas Petazzoni
2018-12-04 8:15 ` Baruch Siach
2018-12-04 8:31 ` Thomas Petazzoni
2018-12-04 8:39 ` Baruch Siach
2018-12-04 9:35 ` [Buildroot] Stack protector choices [was: [PATCH v2, 2/2] lxc: fix build without stack protector] Arnout Vandecappelle
2018-12-04 10:08 ` Thomas Petazzoni [this message]
2018-12-04 15:23 ` [Buildroot] [External] " Matthew Weber
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=20181204110854.17685bf4@windsurf \
--to=thomas.petazzoni@bootlin.com \
--cc=buildroot@busybox.net \
/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