Commit f77fc1af authored by Russell King's avatar Russell King

A pile of missed kernel stack accessing functions were still using

the 'task struct' pointer instead of the 'thread_info' pointer.
This cset fixes up those missed areas.
parent 76536237
...@@ -45,7 +45,7 @@ static inline struct pt_regs * ...@@ -45,7 +45,7 @@ static inline struct pt_regs *
get_user_regs(struct task_struct *task) get_user_regs(struct task_struct *task)
{ {
return (struct pt_regs *) return (struct pt_regs *)
((unsigned long)task + 8192 - sizeof(struct pt_regs)); ((unsigned long)task->thread_info + 8192 - sizeof(struct pt_regs));
} }
/* /*
......
...@@ -116,7 +116,7 @@ static void dump_instr(struct pt_regs *regs) ...@@ -116,7 +116,7 @@ static void dump_instr(struct pt_regs *regs)
static void dump_stack(struct task_struct *tsk, unsigned long sp) static void dump_stack(struct task_struct *tsk, unsigned long sp)
{ {
dump_mem("Stack: ", sp - 16, 8192+(unsigned long)tsk->thread_info); dump_mem("Stack: ", sp, 8192+(unsigned long)tsk->thread_info);
} }
static void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk) static void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk)
...@@ -132,7 +132,7 @@ static void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk) ...@@ -132,7 +132,7 @@ static void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk)
} else if (verify_stack(fp)) { } else if (verify_stack(fp)) {
printk("invalid frame pointer 0x%08x", fp); printk("invalid frame pointer 0x%08x", fp);
ok = 0; ok = 0;
} else if (fp < 4096+(unsigned long)tsk->thread_info) } else if (fp < (unsigned long)(tsk->thread_info + 1))
printk("frame pointer underflow"); printk("frame pointer underflow");
printk("\n"); printk("\n");
...@@ -167,8 +167,8 @@ NORET_TYPE void die(const char *str, struct pt_regs *regs, int err) ...@@ -167,8 +167,8 @@ NORET_TYPE void die(const char *str, struct pt_regs *regs, int err)
printk("Internal error: %s: %x\n", str, err); printk("Internal error: %s: %x\n", str, err);
printk("CPU: %d\n", smp_processor_id()); printk("CPU: %d\n", smp_processor_id());
show_regs(regs); show_regs(regs);
printk("Process %s (pid: %d, stackpage=%08lx)\n", printk("Process %s (pid: %d, stack limit = 0x%p)\n",
current->comm, current->pid, 4096+(unsigned long)tsk); current->comm, current->pid, tsk->thread_info + 1);
if (!user_mode(regs) || in_interrupt()) { if (!user_mode(regs) || in_interrupt()) {
mm_segment_t fs; mm_segment_t fs;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment