From 749da8ae1260145e19d05ce36d384a9628a56c77 Mon Sep 17 00:00:00 2001 From: inference Date: Tue, 17 Jan 2023 01:25:00 +0000 Subject: [PATCH] Remove FORTIFY_SOURCE since it is not compatible with or used by musl libc. Switch stack protector from all to strong since strong covers the entire practical stack smashing protection threat model. Switch -ftrivial-auto-var-init from pattern to zero since it is no longer being removed from Clang and is more suitable for hardening. Sort compiler hardening flags A-Z. Sort linker hardening flags A-Z. --- portage/env/firefox.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/portage/env/firefox.conf b/portage/env/firefox.conf index d47703b..b56abd9 100644 --- a/portage/env/firefox.conf +++ b/portage/env/firefox.conf @@ -3,13 +3,13 @@ # Copyright 2022-2023 Inference # SPDX-License-Identifier: BSD-3-Clause-Clear -# Version: 2.0.0.2 +# Version: 3.0.0.3 # Flags ## Hardening flags -#C_SEC="-fPIE -fPIC -fstack-protector-all -fstack-clash-protection -D_FORTIFY_SOURCE=2 -ftrivial-auto-var-init=pattern -fwrapv" -#LD_SEC="-Wl,-pie -Wl,--strip-all -Wl,-z,defs -Wl,-z,now -Wl,-z,relro" +#C_SEC="-fPIE -fPIC -fstack-clash=protection -fstack-protector-strong -ftrivial-auto-var-init=zero -fwrapv" +#LD_SEC="-Wl,-z,defs -Wl,-z,now -Wl,-pie -Wl,-z,relro -Wl,--strip-all" ## Compiler flags CFLAGS="-march=znver3 -mtune=znver3 -O2 -pipe -U__gnu_linux__" CXXFLAGS="-march=znver3 -mtune=znver3 -O2 -pipe"