Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 113571
b: refs/heads/master
c: 3a18512
h: refs/heads/master
i:
  113569: 2dbec29
  113567: a4a5c99
v: v3
  • Loading branch information
Alexander van Heukelum authored and Ingo Molnar committed Oct 13, 2008
1 parent a216363 commit 9316f4e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 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: 161827903bdc124655f4cd976b9f0a5ac6ebf21c
refs/heads/master: 3a18512db00e0eedca86e3db4d2e81f8fe0b1774
19 changes: 13 additions & 6 deletions trunk/arch/x86/kernel/dumpstack_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,16 @@ void printk_address(unsigned long address, int reliable)
}

static inline int valid_stack_ptr(struct thread_info *tinfo,
void *p, unsigned int size)
void *p, unsigned int size, void *end)
{
void *t = tinfo;
return p > t && p <= t + THREAD_SIZE - size;
if (end) {
if (p < end && p >= (end-THREAD_SIZE))
return 1;
else
return 0;
}
return p > t && p < t + THREAD_SIZE - size;
}

/* The form of the top of the frame on the stack */
Expand All @@ -43,16 +49,17 @@ struct stack_frame {
static inline unsigned long
print_context_stack(struct thread_info *tinfo,
unsigned long *stack, unsigned long bp,
const struct stacktrace_ops *ops, void *data)
const struct stacktrace_ops *ops, void *data,
unsigned long *end)
{
struct stack_frame *frame = (struct stack_frame *)bp;

while (valid_stack_ptr(tinfo, stack, sizeof(*stack))) {
while (valid_stack_ptr(tinfo, stack, sizeof(*stack), end)) {
unsigned long addr;

addr = *stack;
if (__kernel_text_address(addr)) {
if ((unsigned long) stack == bp + 4) {
if ((unsigned long) stack == bp + sizeof(long)) {
ops->address(data, addr, 1);
frame = frame->next_frame;
bp = (unsigned long) frame;
Expand Down Expand Up @@ -96,7 +103,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,

context = (struct thread_info *)
((unsigned long)stack & (~(THREAD_SIZE - 1)));
bp = print_context_stack(context, stack, bp, ops, data);
bp = print_context_stack(context, stack, bp, ops, data, NULL);
/*
* Should be after the line below, but somewhere
* in early boot context comes out corrupted and we
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/kernel/dumpstack_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ print_context_stack(struct thread_info *tinfo,

addr = *stack;
if (__kernel_text_address(addr)) {
if ((unsigned long) stack == bp + 8) {
if ((unsigned long) stack == bp + sizeof(long)) {
ops->address(data, addr, 1);
frame = frame->next_frame;
bp = (unsigned long) frame;
Expand Down

0 comments on commit 9316f4e

Please sign in to comment.