[packages/kernel] configure stack initialization dynamically based on gcc version

atler atler at pld-linux.org
Fri Jul 29 12:55:55 CEST 2022


commit fdc2ddcf632a9840043a92379e993c577596feda
Author: Jan Palus <atler at pld-linux.org>
Date:   Fri Jul 29 12:38:50 2022 +0200

    configure stack initialization dynamically based on gcc version
    
    gcc >= 12 INIT_STACK_ALL_ZERO
    gcc < 12 GCC_PLUGIN_STRUCTLEAK_BYREF_ALL

 kernel-multiarch.config | 2 +-
 kernel.spec             | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/kernel.spec b/kernel.spec
index 3b4b24e8..2179557f 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -890,6 +890,12 @@ BuildConfig() {
 %ifarch x32
 		CONFIG_BPF_PRELOAD=n
 %endif
+%if %{_ver_ge %(rpm -q --qf='%%{VERSION}' gcc) 12}
+		CONFIG_INIT_STACK_ALL_ZERO=y
+		CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL=n
+%else
+		CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL=y
+%endif
 EOCONFIG
 
 %if %{with rescuecd}
diff --git a/kernel-multiarch.config b/kernel-multiarch.config
index d2629601..82817d7f 100644
--- a/kernel-multiarch.config
+++ b/kernel-multiarch.config
@@ -14434,7 +14434,7 @@ GCC_PLUGIN_STRUCTLEAK all=y
 INIT_STACK_NONE all=n
 GCC_PLUGIN_STRUCTLEAK_USER all=n
 GCC_PLUGIN_STRUCTLEAK_BYREF all=n
-GCC_PLUGIN_STRUCTLEAK_BYREF_ALL all=y
+INIT_STACK_ALL_PATTERN all=n
 GCC_PLUGIN_STRUCTLEAK_VERBOSE all=n
 GCC_PLUGIN_STACKLEAK all=y
 STACKLEAK_TRACK_MIN_SIZE all=100
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/kernel.git/commitdiff/f9fc8a48bffd96c5ea73b52dbd9a75ad5d86e539



More information about the pld-cvs-commit mailing list