]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
kbuild: dummy-tools: adjust to stricter stackprotector check
authorMichal Kubecek <mkubecek@suse.cz>
Sat, 15 May 2021 10:11:13 +0000 (12:11 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 13 Apr 2024 10:59:57 +0000 (12:59 +0200)
commit c93db682cfb213501881072a9200a48ce1dc3c3f upstream.

Commit 3fb0fdb3bbe7 ("x86/stackprotector/32: Make the canary into a regular
percpu variable") modified the stackprotector check on 32-bit x86 to check
if gcc supports using %fs as canary. Adjust dummy-tools gcc script to pass
this new test by returning "%fs" rather than "%gs" if it detects
-mstack-protector-guard-reg=fs on command line.

Fixes: 3fb0fdb3bbe7 ("x86/stackprotector/32: Make the canary into a regular percpu variable")
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
scripts/dummy-tools/gcc

index 485427f40dba82b47e14c5f1980c92b8af1e6faa..91df612bf9374855ae196c68c7b053b477f67fea 100755 (executable)
@@ -76,7 +76,11 @@ fi
 if arg_contain -S "$@"; then
        # For scripts/gcc-x86-*-has-stack-protector.sh
        if arg_contain -fstack-protector "$@"; then
-               echo "%gs"
+               if arg_contain -mstack-protector-guard-reg=fs "$@"; then
+                       echo "%fs"
+               else
+                       echo "%gs"
+               fi
                exit 0
        fi
 fi