Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 8636
b: refs/heads/master
c: 049cdef
h: refs/heads/master
v: v3
  • Loading branch information
Jan Beulich authored and Linus Torvalds committed Sep 12, 2005
1 parent 525d5f5 commit 6bef34a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 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: c47a3167d0454c0af5fb0a0322b01a0e3487798e
refs/heads/master: 049cdefe19f95b67b06b70915cd8e4ae7173337a
8 changes: 4 additions & 4 deletions trunk/arch/x86_64/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,13 +321,13 @@ void handle_BUG(struct pt_regs *regs)
if (__copy_from_user(&f, (struct bug_frame *) regs->rip,
sizeof(struct bug_frame)))
return;
if ((unsigned long)f.filename < __PAGE_OFFSET ||
if (f.filename >= 0 ||
f.ud2[0] != 0x0f || f.ud2[1] != 0x0b)
return;
if (__get_user(tmp, f.filename))
f.filename = "unmapped filename";
if (__get_user(tmp, (char *)(long)f.filename))
f.filename = (int)(long)"unmapped filename";
printk("----------- [cut here ] --------- [please bite here ] ---------\n");
printk(KERN_ALERT "Kernel BUG at %.50s:%d\n", f.filename, f.line);
printk(KERN_ALERT "Kernel BUG at %.50s:%d\n", (char *)(long)f.filename, f.line);
}

#ifdef CONFIG_BUG
Expand Down
10 changes: 4 additions & 6 deletions trunk/include/asm-x86_64/bug.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
*/
struct bug_frame {
unsigned char ud2[2];
unsigned char mov;
/* should use 32bit offset instead, but the assembler doesn't
like it */
char *filename;
unsigned char push;
signed int filename;
unsigned char ret;
unsigned short line;
} __attribute__((packed));
Expand All @@ -25,8 +23,8 @@ struct bug_frame {
The magic numbers generate mov $64bitimm,%eax ; ret $offset. */
#define BUG() \
asm volatile( \
"ud2 ; .byte 0xa3 ; .quad %c1 ; .byte 0xc2 ; .short %c0" :: \
"i"(__LINE__), "i" (__stringify(__FILE__)))
"ud2 ; pushq $%c1 ; ret $%c0" :: \
"i"(__LINE__), "i" (__FILE__))
void out_of_line_bug(void);
#else
static inline void out_of_line_bug(void) { }
Expand Down

0 comments on commit 6bef34a

Please sign in to comment.