]> git.baikalelectronics.ru Git - kernel.git/commit
gcc-plugins: arm_ssp_per_task_plugin: fix for GCC 9+
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 18 Jan 2019 10:58:07 +0000 (11:58 +0100)
committerKees Cook <keescook@chromium.org>
Sun, 20 Jan 2019 22:06:40 +0000 (14:06 -0800)
commitf8394f08bdf7f8f09dda1a6887bac3ac030c4d4f
treeed580e8080a047597b44f12afc534adc3dce43c3
parent61f2d7e5be83238dab160dbfaa6052dcdbf9d8a8
gcc-plugins: arm_ssp_per_task_plugin: fix for GCC 9+

GCC 9 reworks the way the references to the stack canary are
emitted, to prevent the value from being spilled to the stack
before the final comparison in the epilogue, defeating the
purpose, given that the spill slot is under control of the
attacker that we are protecting ourselves from.

Since our canary value address is obtained without accessing
memory (as opposed to pre-v7 code that will obtain it from a
literal pool), it is unlikely (although not guaranteed) that
the compiler will spill the canary value in the same way, so
let's just disable this improvement when building with GCC9+.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
scripts/gcc-plugins/arm_ssp_per_task_plugin.c