Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 41125
b: refs/heads/master
c: c547c77
h: refs/heads/master
i:
  41123: 5d5ae3d
v: v3
  • Loading branch information
Andi Kleen authored and Andi Kleen committed Nov 28, 2006
1 parent 514afc9 commit c886f78
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 38b5b036b91248be8033d42dd0778b1c75c5af58
refs/heads/master: c547c77ee4d0408907847f64c403df1bf2f9c7a0
10 changes: 9 additions & 1 deletion trunk/arch/x86_64/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,19 @@ static int dump_trace_unwind(struct unwind_frame_info *info, void *context)
* severe exception (double fault, nmi, stack fault, debug, mce) hardware stack
*/

static inline int valid_stack_ptr(struct thread_info *tinfo, void *p)
{
void *t = (void *)tinfo;
return p > t && p < t + THREAD_SIZE - 3;
}

void dump_trace(struct task_struct *tsk, struct pt_regs *regs, unsigned long * stack,
struct stacktrace_ops *ops, void *data)
{
const unsigned cpu = smp_processor_id();
unsigned long *irqstack_end = (unsigned long *)cpu_pda(cpu)->irqstackptr;
unsigned used = 0;
struct thread_info *tinfo;

if (!tsk)
tsk = current;
Expand Down Expand Up @@ -370,7 +377,8 @@ void dump_trace(struct task_struct *tsk, struct pt_regs *regs, unsigned long * s
/*
* This handles the process stack:
*/
HANDLE_STACK (((long) stack & (THREAD_SIZE-1)) != 0);
tinfo = current_thread_info();
HANDLE_STACK (valid_stack_ptr(tinfo, stack));
#undef HANDLE_STACK
}
EXPORT_SYMBOL(dump_trace);
Expand Down

0 comments on commit c886f78

Please sign in to comment.