[PATCH 32/72] Blackfin: do not try displaying the end of the stack

From: Mike Frysinger
Date: Mon Sep 14 2009 - 16:16:02 EST


From: Sonic Zhang <sonic.zhang@xxxxxxxxxx>

The end of the stack may not be valid (and that could be OK), so do not
attempt to parse it. If we do, we might use a bad pointer in kernel space
which makes things panic().

Signed-off-by: Sonic Zhang <sonic.zhang@xxxxxxxxxx>
Signed-off-by: Mike Frysinger <vapier@xxxxxxxxxx>
---
arch/blackfin/kernel/traps.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c
index 519acca..18c6cd4 100644
--- a/arch/blackfin/kernel/traps.c
+++ b/arch/blackfin/kernel/traps.c
@@ -911,7 +911,7 @@ void show_stack(struct task_struct *task, unsigned long *stack)
frame_no = 0;

for (addr = (unsigned int *)((unsigned int)stack & ~0xF), i = 0;
- addr <= endstack; addr++, i++) {
+ addr < endstack; addr++, i++) {

ret_addr = 0;
if (!j && i % 8 == 0)
--
1.6.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/