ARM: 8948/1: Prevent OOB access in stacktrace
[linux-2.6-microblaze.git] / arch / arm / kernel / stacktrace.c
index 71778bb..cc726af 100644 (file)
@@ -92,6 +92,8 @@ static int save_trace(struct stackframe *frame, void *d)
                return 0;
 
        regs = (struct pt_regs *)frame->sp;
+       if ((unsigned long)&regs[1] > ALIGN(frame->sp, THREAD_SIZE))
+               return 0;
 
        trace->entries[trace->nr_entries++] = regs->ARM_pc;