riscv: traps: add missing prototype
authorConor Dooley <conor.dooley@microchip.com>
Sun, 14 Aug 2022 14:12:38 +0000 (15:12 +0100)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 18 Aug 2022 21:42:58 +0000 (14:42 -0700)
Sparse complains:
arch/riscv/kernel/traps.c:213:6: warning: symbol 'shadow_stack' was not declared. Should it be static?

The variable is used in entry.S, so declare shadow_stack there
alongside SHADOW_OVERFLOW_STACK_SIZE.

Fixes: 31da94c25aea ("riscv: add VMAP_STACK overflow detection")
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20220814141237.493457-5-mail@conchuod.ie
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/include/asm/thread_info.h
arch/riscv/kernel/traps.c

index 78933ac04995b2d22f545bd8d7853743440c5e49..67322f878e0d7828178a51fb0cff047270d59a2a 100644 (file)
@@ -42,6 +42,8 @@
 
 #ifndef __ASSEMBLY__
 
+extern long shadow_stack[SHADOW_OVERFLOW_STACK_SIZE / sizeof(long)];
+
 #include <asm/processor.h>
 #include <asm/csr.h>
 
index 39d0f8bba4b40e3e22ac8125c628f50d919bd346..635e6ec269380214b86f766897ae05ee18090ecb 100644 (file)
 
 #include <asm/asm-prototypes.h>
 #include <asm/bug.h>
+#include <asm/csr.h>
 #include <asm/processor.h>
 #include <asm/ptrace.h>
-#include <asm/csr.h>
+#include <asm/thread_info.h>
 
 int show_unhandled_signals = 1;