summaryrefslogtreecommitdiffstats
path: root/lib/kasan/test_kasan.c
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2022-12-12 17:39:06 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2022-12-13 09:37:08 +0100
commit337693e66d25c3ff3de6a71c853c2328c934eefd (patch)
tree1e556df5754262cfb427da4c857c30b3b0d1c24d /lib/kasan/test_kasan.c
parent9917db36e42acac81ff914faf19af3d95e90e327 (diff)
downloadbarebox-337693e66d25c3ff3de6a71c853c2328c934eefd.tar.gz
barebox-337693e66d25c3ff3de6a71c853c2328c934eefd.tar.xz
KASan: test_kasan: silence warning with newer GCC
Newer GCC will rightly complain about this being an out-of-bounds access. This is intended as the kasan command is meant to cause out-of-bounds accesses to test proper operation of KASan. Thus silence the warning for this specific instance. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221212163907.2356192-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'lib/kasan/test_kasan.c')
-rw-r--r--lib/kasan/test_kasan.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/kasan/test_kasan.c b/lib/kasan/test_kasan.c
index d0ea915477..14511cdb80 100644
--- a/lib/kasan/test_kasan.c
+++ b/lib/kasan/test_kasan.c
@@ -290,6 +290,8 @@ static noinline void kasan_alloca_oob_left(void)
char alloca_array[i];
char *p = alloca_array - 1;
+ OPTIMIZER_HIDE_VAR(p);
+
pr_info("out-of-bounds to left on alloca\n");
*(volatile char *)p;
}