aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/traps.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2006-09-27 04:51:15 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-27 11:26:20 -0400
commit1e2af92e089d4c845248844a3e7ee06ce889af46 (patch)
treef5c995fa5b56cc3f7be030efe5ced10f0cbc70f9 /arch/i386/kernel/traps.c
parent1b79e5513d52e8533a08af35a3595dad80c74d1f (diff)
[PATCH] x86: use probe_kernel_address in handle_BUG()
Avoid possible deadlock on a BUG() inside down_write(mmap_sem). The deadlock can only occur if something has gone horridly wrong, because a fault here shouldn't happen. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386/kernel/traps.c')
-rw-r--r--arch/i386/kernel/traps.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index 21aa1cd57773..a13037fe0ee3 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -28,6 +28,7 @@
28#include <linux/kprobes.h> 28#include <linux/kprobes.h>
29#include <linux/kexec.h> 29#include <linux/kexec.h>
30#include <linux/unwind.h> 30#include <linux/unwind.h>
31#include <linux/uaccess.h>
31 32
32#ifdef CONFIG_EISA 33#ifdef CONFIG_EISA
33#include <linux/ioport.h> 34#include <linux/ioport.h>
@@ -40,7 +41,6 @@
40 41
41#include <asm/processor.h> 42#include <asm/processor.h>
42#include <asm/system.h> 43#include <asm/system.h>
43#include <asm/uaccess.h>
44#include <asm/io.h> 44#include <asm/io.h>
45#include <asm/atomic.h> 45#include <asm/atomic.h>
46#include <asm/debugreg.h> 46#include <asm/debugreg.h>
@@ -409,7 +409,7 @@ static void handle_BUG(struct pt_regs *regs)
409 409
410 if (eip < PAGE_OFFSET) 410 if (eip < PAGE_OFFSET)
411 return; 411 return;
412 if (__get_user(ud2, (unsigned short __user *)eip)) 412 if (probe_kernel_address((unsigned short __user *)eip, ud2))
413 return; 413 return;
414 if (ud2 != 0x0b0f) 414 if (ud2 != 0x0b0f)
415 return; 415 return;
@@ -422,7 +422,8 @@ static void handle_BUG(struct pt_regs *regs)
422 char *file; 422 char *file;
423 char c; 423 char c;
424 424
425 if (__get_user(line, (unsigned short __user *)(eip + 2))) 425 if (probe_kernel_address((unsigned short __user *)(eip + 2),
426 line))
426 break; 427 break;
427 if (__get_user(file, (char * __user *)(eip + 4)) || 428 if (__get_user(file, (char * __user *)(eip + 4)) ||
428 (unsigned long)file < PAGE_OFFSET || __get_user(c, file)) 429 (unsigned long)file < PAGE_OFFSET || __get_user(c, file))