mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-06-12 17:14:46 +02:00
Hardening: add -fzero-call-used-regs=used-gpr
Is defense in depth to make ROP harder. In general this is reported to have a performance impact of 2% worst-case. Linux kernel reports 1%. Should be closer to 0% for us, or that 1% if i am wrong. https://lwn.net/Articles/870045/ has some background on this.
This commit is contained in:
@@ -150,6 +150,9 @@ AS_IF([test x"$hardening" != x"no"], [
|
||||
# Since we have moved from name[1] to name[], setting this should help bounds checking:
|
||||
check_cc_flag([-fstrict-flex-arrays=3], [HARDEN_CFLAGS="$HARDEN_CFLAGS -fstrict-flex-arrays=3"])
|
||||
|
||||
# Clear registers on return (performance penalty, but acceptable, makes ROP harder)
|
||||
check_cc_flag([-fzero-call-used-regs=used-gpr], [HARDEN_CFLAGS="$HARDEN_CFLAGS -fzero-call-used-regs=used-gpr"])
|
||||
|
||||
# At the link step, we might want -pie (GCC) or -Wl,-pie (Clang on OS X)
|
||||
#
|
||||
# The linker checks also compile code, so we need to include -fPIE as well.
|
||||
|
||||
Reference in New Issue
Block a user