diff options
Diffstat (limited to 'arch/i386/kernel/traps.c')
-rw-r--r-- | arch/i386/kernel/traps.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c index 7e9edafffd8a..4fcc6690be99 100644 --- a/arch/i386/kernel/traps.c +++ b/arch/i386/kernel/traps.c | |||
@@ -313,6 +313,8 @@ void show_registers(struct pt_regs *regs) | |||
313 | */ | 313 | */ |
314 | if (in_kernel) { | 314 | if (in_kernel) { |
315 | u8 __user *eip; | 315 | u8 __user *eip; |
316 | int code_bytes = 64; | ||
317 | unsigned char c; | ||
316 | 318 | ||
317 | printk("\n" KERN_EMERG "Stack: "); | 319 | printk("\n" KERN_EMERG "Stack: "); |
318 | show_stack_log_lvl(NULL, regs, (unsigned long *)esp, KERN_EMERG); | 320 | show_stack_log_lvl(NULL, regs, (unsigned long *)esp, KERN_EMERG); |
@@ -320,9 +322,12 @@ void show_registers(struct pt_regs *regs) | |||
320 | printk(KERN_EMERG "Code: "); | 322 | printk(KERN_EMERG "Code: "); |
321 | 323 | ||
322 | eip = (u8 __user *)regs->eip - 43; | 324 | eip = (u8 __user *)regs->eip - 43; |
323 | for (i = 0; i < 64; i++, eip++) { | 325 | if (eip < (u8 __user *)PAGE_OFFSET || __get_user(c, eip)) { |
324 | unsigned char c; | 326 | /* try starting at EIP */ |
325 | 327 | eip = (u8 __user *)regs->eip; | |
328 | code_bytes = 32; | ||
329 | } | ||
330 | for (i = 0; i < code_bytes; i++, eip++) { | ||
326 | if (eip < (u8 __user *)PAGE_OFFSET || __get_user(c, eip)) { | 331 | if (eip < (u8 __user *)PAGE_OFFSET || __get_user(c, eip)) { |
327 | printk(" Bad EIP value."); | 332 | printk(" Bad EIP value."); |
328 | break; | 333 | break; |