diff options
author | Kyle Evans <kevans@FreeBSD.org> | 2020-03-14 15:15:27 +0000 |
---|---|---|
committer | Kyle Evans <kevans@FreeBSD.org> | 2020-03-14 15:15:27 +0000 |
commit | 19fe57fdb4fd2c18a37f2a972617c8769609cdb8 (patch) | |
tree | 2f378400216d1f338e5f6c0f712801895a857b44 /lib/libssp | |
parent | 1b786d01917ccd90f4b2fffab8e735a25707e63d (diff) | |
download | src-19fe57fdb4fd2c18a37f2a972617c8769609cdb8.tar.gz src-19fe57fdb4fd2c18a37f2a972617c8769609cdb8.zip |
libssp: don't compile with -fstack-protector*
This similarly matches what we do in libc; compiling libssp with
-fstack-protector* is actively harmful. For instance, if the canary ctor
ends up with a stack protector then it will trivially trigger a false
positive as the canary's being initialized.
This was noted by the reporter as irc/ircd-hybrid started crashing at start
after our libssp was MFC'd to stable/11, as its build will explicitly link
in libssp. On FreeBSD, this isn't necessary as SSP bits are included in
libc, but it should absolutely not trigger runtime breakage -- it does mean
that the canary will get initialized twice, but as this is happening early
on in application startup it should just be redundant work.
Reported by: Tod McQuillin <devin@sevenlayer.studio>
MFC after: 3 days
Notes
Notes:
svn path=/head/; revision=358993
Diffstat (limited to 'lib/libssp')
-rw-r--r-- | lib/libssp/Makefile | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libssp/Makefile b/lib/libssp/Makefile index 63c4f5e6557f..e09c4d3d2a2e 100644 --- a/lib/libssp/Makefile +++ b/lib/libssp/Makefile @@ -17,4 +17,8 @@ SRCS= stack_protector.c fortify_stubs.c CFLAGS.fortify_stubs.c= -Wno-unused-parameter +# Stack protection on libssp symbols should be considered harmful, as we may +# be talking about, for example, the guard setup constructor. +SSP_CFLAGS:= + .include <bsd.lib.mk> |