Skip to content

Commit

Permalink
riscv: traps: add missing prototype
Browse files Browse the repository at this point in the history
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: 31da94c ("riscv: add VMAP_STACK overflow detection")
Signed-off-by: Conor Dooley <[email protected]>
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Palmer Dabbelt <[email protected]>
  • Loading branch information
ConchuOD authored and palmer-dabbelt committed Aug 18, 2022
1 parent b5c3aca commit d951b20
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions arch/riscv/include/asm/thread_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@

#ifndef __ASSEMBLY__

extern long shadow_stack[SHADOW_OVERFLOW_STACK_SIZE / sizeof(long)];

#include <asm/processor.h>
#include <asm/csr.h>

Expand Down
3 changes: 2 additions & 1 deletion arch/riscv/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@

#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;

Expand Down

0 comments on commit d951b20

Please sign in to comment.