From 589965c32109fecfc130194434e2556dfdeac6b6 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Fri, 22 Jan 2021 15:27:35 -0500 Subject: [PATCH] aarch64: blacklist gcc prior to 5.1 Linux aarch64 requires GCC 5.1 or better because prior versions perform unsafe access to deallocated stack. Some Linux distributions may have backported the fix, but it was never released into earlier upstream gcc versions. Link: https://lwn.net/Articles/842122/ Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63293 Signed-off-by: Mathieu Desnoyers --- README.md | 2 ++ include/urcu/arch/aarch64.h | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/README.md b/README.md index 539a964..37f30f4 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,8 @@ supported, with the following exceptions: - Alpha, ia64 and ARM architectures depend on GCC 4.x with atomic builtins support. For ARM this was introduced with GCC 4.4: http://gcc.gnu.org/gcc-4.4/changes.html. + - Linux aarch64 depends on GCC 5.1 or better because prior versions + perform unsafe access to deallocated stack. Clang version 3.0 (based on LLVM 3.0) is supported. diff --git a/include/urcu/arch/aarch64.h b/include/urcu/arch/aarch64.h index d6a1337..9e2f1ff 100644 --- a/include/urcu/arch/aarch64.h +++ b/include/urcu/arch/aarch64.h @@ -42,6 +42,15 @@ extern "C" { #define __NR_membarrier 283 #endif +/* + * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63293 + */ +#ifdef URCU_GCC_VERSION +# if URCU_GCC_VERSION < 50100 +# error Your gcc version performs unsafe access to deallocated stack +# endif +#endif + #ifdef __cplusplus } #endif -- 2.34.1