Index: sys/arm/arm/unwind.c =================================================================== --- sys/arm/arm/unwind.c +++ sys/arm/arm/unwind.c @@ -36,6 +36,7 @@ #include #include +#include #include "linker_if.h" @@ -223,6 +224,13 @@ if (state->entries == 0) return 1; + /* Detect a bad stack pointer */ + if (!INKERNEL(vsp) || (vm_offset_t)vsp >= 0xffffff00) { + printf("%s: vsp %x %x\n", __func__, state->registers[LR], + state->registers[PC]); + return 1; + } + /* Read the next instruction */ insn = unwind_exec_read_byte(state);