[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <13e53f8f5dab1e3e070b4cb34bbe8b89f85f5326.1621076083.git.mkubecek@suse.cz>
Date: Sat, 15 May 2021 12:11:13 +0200
From: Michal Kubecek <mkubecek@...e.cz>
To: Masahiro Yamada <masahiroy@...nel.org>,
linux-kbuild@...r.kernel.org
Cc: Michal Marek <michal.lkml@...kovi.net>,
Andy Lutomirski <luto@...nel.org>,
Borislav Petkov <bp@...e.de>, linux-kernel@...r.kernel.org
Subject: [PATCH] kbuild: dummy-tools: adjust to stricter stackprotector check
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@...e.cz>
---
scripts/dummy-tools/gcc | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/scripts/dummy-tools/gcc b/scripts/dummy-tools/gcc
index f6d543725f1e..b2483149bbe5 100755
--- a/scripts/dummy-tools/gcc
+++ b/scripts/dummy-tools/gcc
@@ -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
--
2.31.1
Powered by blists - more mailing lists