aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/constexpr.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2020-08-05 15:18:36 +0100
committerGiuliano Belinassi <giuliano.belinassi@usp.br>2020-08-17 15:07:40 -0300
commit6316834ed9731a385236b9ebdcc8057aeb40b508 (patch)
tree6bf2e5e821f404f303f54eb9ab7d71418c20f9a2 /gcc/cp/constexpr.c
parent7d823797d2298e12a56c79504a5d255894cd32c8 (diff)
downloadgcc-6316834ed9731a385236b9ebdcc8057aeb40b508.zip
gcc-6316834ed9731a385236b9ebdcc8057aeb40b508.tar.gz
gcc-6316834ed9731a385236b9ebdcc8057aeb40b508.tar.bz2
aarch64: Clear canary value after stack_protect_test [PR96191]
The stack_protect_test patterns were leaving the canary value in the temporary register, meaning that it was often still in registers on return from the function. An attacker might therefore have been able to use it to defeat stack-smash protection for a later function. gcc/ PR target/96191 * config/aarch64/aarch64.md (stack_protect_test_<mode>): Set the CC register directly, instead of a GPR. Replace the original GPR destination with an extra scratch register. Zero out operand 3 after use. (stack_protect_test): Update accordingly. gcc/testsuite/ PR target/96191 * gcc.target/aarch64/stack-protector-1.c: New test. * gcc.target/aarch64/stack-protector-2.c: Likewise.
Diffstat (limited to 'gcc/cp/constexpr.c')
0 files changed, 0 insertions, 0 deletions