public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* --enable-stack-protector for glibc.
@ 2016-02-20 10:23 Nix
  2016-02-20 10:23 ` [PATCH 04/12] Allow overriding of CFLAGS as well as CPPFLAGS for rtld Nix
                   ` (11 more replies)
  0 siblings, 12 replies; 31+ messages in thread
From: Nix @ 2016-02-20 10:23 UTC (permalink / raw)
  To: libc-alpha; +Cc: carlos

So this is the provisional "stack-protect glibc" patch, a version of which has
been running for many, many years on my (x86-32 Geode) firewall.  No changelog
yet, but I'll write one soonish.  (When I do, it'll cite glibc bug 7065.  Bug
7066, a buffer overrun in strtold(), was uncovered during the initial
development of this patch, many years ago.)

It's against glibc head as of a few days ago, a5df3210a641c17.

I've gone through it and dropped things that don't seem to have any
justification nor affect testsuite results.  Some of the things thus dropped may
in fact be important for proper functioning of things like error messages from
statically linked programs when running against a kernel too old for the glibc:
I haven't retested that case, but it is plausible.  (I'll test that case at some
point in the next few days, but after many dozens of 64- and 32-bit x86 glibc
build-and-tests with every combination of
--enable-stack-protector={no,yes,all,strong} / --enable-omitfp /
--enable-stackguard-randomization I had frankly had enough of that for now!)

The testsuite passes with every combination of those flags (other than various
combinations with --enable-stack-protector=no, that seemed pointless to test):
no failures are observed with it that are not also observed on an unpatched
glibc with the same flag combinations.  However, until last night two things
were failing: I figured out how to stop them, but I don't understand why this
patch works and why, if it works, many others aren't needed (see the last patch
in the series).


I have not even considered investigating the performance of this.  Suffice to
say that with everything *but* glibc stack-protected on many distros, and with
perforamnce appearing quite acceptable to me on a 32-bit 500MHz embedded
processor, the performance implications of this patch do not appear to be
catastrophic. It's probably the same as the stack-protector always is: a few
percent.

The patches themselves have my work address on them because I just spent
a couple of work days on them.

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2016-02-22 21:23 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-20 10:23 --enable-stack-protector for glibc Nix
2016-02-20 10:23 ` [PATCH 04/12] Allow overriding of CFLAGS as well as CPPFLAGS for rtld Nix
2016-02-20 10:24 ` [PATCH 06/12] Compile the entire dynamic linker with -fno-stack-protector Nix
2016-02-20 10:24 ` [PATCH 03/12] Initialize the stack guard earlier when linking statically Nix
2016-02-20 10:24 ` [PATCH 07/12] Link libc.so with libc_nonshared.a to pull in __stack_chk_fail Nix
2016-02-20 10:24 ` [PATCH 01/12] Configury support for --enable-stack-protector Nix
2016-02-20 10:44   ` Andreas Schwab
2016-02-20 12:03     ` Nix
2016-02-20 13:10       ` Andreas Schwab
2016-02-20 15:04     ` Nix
2016-02-20 17:30   ` Joseph Myers
2016-02-21 12:40     ` Nix
2016-02-21 22:31     ` Nix
2016-02-22 18:03       ` Joseph Myers
2016-02-22 21:23         ` Nix
2016-02-20 10:24 ` [PATCH 08/12] Link various tests with -fno-stack-protector Nix
2016-02-20 10:25 ` [PATCH 05/12] Mark all machinery needed in early static-link init as -fno-stack-protector Nix
2016-02-20 10:25 ` [PATCH 02/12] Make __stack_chk_fail() not use other glibc facilities Nix
2016-02-20 12:06   ` Nix
2016-02-20 17:19     ` Mike Frysinger
2016-02-21 12:44       ` Nix
2016-02-22  1:20         ` Mike Frysinger
2016-02-22 12:32           ` Nix
2016-02-22 19:45       ` Nix
2016-02-20 17:36   ` Joseph Myers
2016-02-20 10:25 ` [PATCH 12/12] Avoid stack-protecting certain functions called from assembly Nix
2016-02-20 10:25 ` [PATCH 10/12] Work even with compilers hacked to enable -fstack-protector by default Nix
2016-02-20 17:32   ` Joseph Myers
2016-02-21 15:11     ` Nix
2016-02-20 10:25 ` [PATCH 11/12] Drop explicit stack-protection of pieces of the system Nix
2016-02-20 10:25 ` [PATCH 09/12] Enable -fstack-protector=* when requested by configure Nix

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).