Commit 7e04a118 authored by Chuck Ebbert's avatar Chuck Ebbert Committed by Linus Torvalds

[PATCH] i386: extra checks in show_registers()

Sometimes thread_info and task_struct get out-of-sync with each other.
Printing task.thread_info in show_registers() can help spot this.  And when
task_struct is corrupt then task.comm can contain garbage, so only print as
many characters as it can hold.
Signed-off-by: default avatarChuck Ebbert <76306.1226@compuserve.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 722f4f5b
...@@ -274,8 +274,9 @@ void show_registers(struct pt_regs *regs) ...@@ -274,8 +274,9 @@ void show_registers(struct pt_regs *regs)
regs->esi, regs->edi, regs->ebp, esp); regs->esi, regs->edi, regs->ebp, esp);
printk(KERN_EMERG "ds: %04x es: %04x ss: %04x\n", printk(KERN_EMERG "ds: %04x es: %04x ss: %04x\n",
regs->xds & 0xffff, regs->xes & 0xffff, ss); regs->xds & 0xffff, regs->xes & 0xffff, ss);
printk(KERN_EMERG "Process %s (pid: %d, threadinfo=%p task=%p)", printk(KERN_EMERG "Process %.*s (pid: %d, ti=%p task=%p task.ti=%p)",
current->comm, current->pid, current_thread_info(), current); TASK_COMM_LEN, current->comm, current->pid,
current_thread_info(), current, current->thread_info);
/* /*
* When in-kernel, we also print out the stack and code at the * When in-kernel, we also print out the stack and code at the
* time of the fault.. * time of the fault..
......
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