From 19fe57fdb4fd2c18a37f2a972617c8769609cdb8 Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Sat, 14 Mar 2020 15:15:27 +0000 Subject: [PATCH] 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 MFC after: 3 days --- lib/libssp/Makefile | 4 ++++ 1 file changed, 4 insertions(+) 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