Skip to content

Commit

Permalink
kbuild: dummy-tools: adjust to stricter stackprotector check
Browse files Browse the repository at this point in the history
Commit 3fb0fdb ("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: 3fb0fdb ("x86/stackprotector/32: Make the canary into a regular percpu variable")
Signed-off-by: Michal Kubecek <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
  • Loading branch information
mkubecek authored and masahir0y committed May 17, 2021
1 parent 98a499a commit c93db68
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/dummy-tools/gcc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit c93db68

Please sign in to comment.