environment/configure/hardening.sh: enable -fstack-clash-protection
This flag will make GCC 8 touch all space allocated using alloca(3) and thus detect code jumping over the "stack gap".
This commit is contained in:
@@ -17,8 +17,8 @@ if [ -z "$nopie" ]; then
|
|||||||
LDFLAGS="-specs=${_GCCSPECSDIR}/hardened-ld -Wl,-z,relro -Wl,-z,now ${LDFLAGS}"
|
LDFLAGS="-specs=${_GCCSPECSDIR}/hardened-ld -Wl,-z,relro -Wl,-z,now ${LDFLAGS}"
|
||||||
else
|
else
|
||||||
# Enable FORITFY_SOURCE=2
|
# Enable FORITFY_SOURCE=2
|
||||||
CFLAGS="-D_FORTIFY_SOURCE=2 ${CFLAGS}"
|
CFLAGS="-fstack-clash-protection -D_FORTIFY_SOURCE=2 ${CFLAGS}"
|
||||||
CXXFLAGS="-D_FORTIFY_SOURCE=2 ${CXXFLAGS}"
|
CXXFLAGS="-fstack-clash-protection -D_FORTIFY_SOURCE=2 ${CXXFLAGS}"
|
||||||
LDFLAGS="-Wl,-z,relro -Wl,-z,now ${LDFLAGS}"
|
LDFLAGS="-Wl,-z,relro -Wl,-z,now ${LDFLAGS}"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user