Gentoo Archives: gentoo-user

From: Fernando Rodriguez <frodriguez.developer@×××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: Anyone running a hardened profile?
Date: Tue, 08 Sep 2015 20:43:27
Message-Id: BLU436-SMTP70C5CFF2A3B0D5657260248D530@phx.gbl
In Reply to: Re: [gentoo-user] Re: Anyone running a hardened profile? by Michael Orlitzky
1 On Monday, September 07, 2015 9:38:25 PM Michael Orlitzky wrote:
2 > On 09/07/2015 09:15 PM, walt wrote:
3 > >
4 > > Full SSP is something I want and I'll gladly suffer the speed penalty
5 > > to get it. Can I just add -fstack-protector-all to my CFLAGS in
6 > > make.conf?
7 > >
8 >
9 > Basically, but to save yourself some headaches, you should switch to a
10 > hardened profile instead. Otherwise you'll get build failures of things
11 > like glibc. The profile takes care of that for you, but otherwise
12 > enables full SSP.
13
14 I have -fstack-protector-all enabled in my router/firewall for over a year and
15 I don't remember any build failures. I don't have a lot of packages in it but
16 I certainly have glibc. I think it just overrides the setting.
17
18 > The binary distros are all moving towards -fstack-protector-strong now
19 > so support for this stuff is getting better upstream.
20 >
21 >
22 > > Hmm. Quoting from the gcc man page:
23 > >
24 > > -fstack-protector-strong
25 > > Like -fstack-protector but includes additional functions to
26 > > be protected --- those that have local array definitions, or
27 > > have references to local frame addresses.
28 > >
29 > > NOTE: In Gentoo GCC 4.9.0 and later versions this option is
30 > > enabled by default for C, C++, ObjC, ObjC++, if neither
31 > > -fno-stack-protector, -nostdlib, -ffreestanding,
32 > > -fstack-protector, -fstack-protector-strong or
33 > > -fstack-protector-all are found. <===== are found *where*?
34 > >
35 > > English is my native tongue and I confess I can't make any sense of
36 > > that advice.
37 > >
38 >
39 > You'll get the "strong" stack protection unless you ask for some other
40 > level of protection via CFLAGS or CXXFLAGS or wherever else. Note that
41 > "strong" is still less than "all"!
42 >
43 >
44 >
45
46 --
47 Fernando Rodriguez