
From: Ingo Molnar <mingo@redhat.com>

Found a 4:4 bug that caused BUG()s to be garbled - patch attached.  (This
was new code after 4:4 was done and i missed that it has some 3:1
assumptions.) Patch is against recent 2.6.4-rc-mm, should apply to any
recent 4:4 tree.

The primary effect of the bug was that the kernel, upon encountering a
BUG(), didnt print the 'BUG at file:line' message.  Moreover, on modular
kernels, if a BUG() was done within the module, the kernel also did a
__get_user() - which, if done in an atomic section, and if the MM semaphore
was held, could triggers an additional __might_sleep() message.


---

 arch/i386/kernel/traps.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff -puN arch/i386/kernel/traps.c~4g4g-handle_BUG-fix arch/i386/kernel/traps.c
--- 25/arch/i386/kernel/traps.c~4g4g-handle_BUG-fix	2004-03-07 01:06:55.000000000 -0800
+++ 25-akpm/arch/i386/kernel/traps.c	2004-03-07 01:06:55.000000000 -0800
@@ -271,16 +271,14 @@ static void handle_BUG(struct pt_regs *r
 
 	eip = regs->eip;
 
-	if (eip < PAGE_OFFSET)
-		goto no_bug;
-	if (__get_user(ud2, (unsigned short *)eip))
+	if (__direct_get_user(ud2, (unsigned short *)eip))
 		goto no_bug;
 	if (ud2 != 0x0b0f)
 		goto no_bug;
-	if (__get_user(line, (unsigned short *)(eip + 2)))
+	if (__direct_get_user(line, (unsigned short *)(eip + 2)))
 		goto bug;
-	if (__get_user(file, (char **)(eip + 4)) ||
-		(unsigned long)file < PAGE_OFFSET || __get_user(c, file))
+	if (__direct_get_user(file, (char **)(eip + 4)) ||
+			__direct_get_user(c, file))
 		file = "<bad filename>";
 
 	printk("------------[ cut here ]------------\n");

_
