From: Andrew Morton Avoid possible deadlock on a BUG() inside down_write(mmap_sem). The deadlock can only occur if something has gone horridly wrong, because an fault here shouldn't happen. Signed-off-by: Andrew Morton --- arch/i386/kernel/traps.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff -puN arch/i386/kernel/traps.c~x86-use-probe_kernel_address-in-handle_bug arch/i386/kernel/traps.c --- a/arch/i386/kernel/traps.c~x86-use-probe_kernel_address-in-handle_bug +++ a/arch/i386/kernel/traps.c @@ -28,6 +28,7 @@ #include #include #include +#include #ifdef CONFIG_EISA #include @@ -40,7 +41,6 @@ #include #include -#include #include #include #include @@ -407,7 +407,7 @@ static void handle_BUG(struct pt_regs *r if (eip < PAGE_OFFSET) return; - if (__get_user(ud2, (unsigned short __user *)eip)) + if (probe_kernel_address((unsigned short __user *)eip, ud2)) return; if (ud2 != 0x0b0f) return; @@ -420,7 +420,8 @@ static void handle_BUG(struct pt_regs *r char *file; char c; - if (__get_user(line, (unsigned short __user *)(eip + 2))) + if (probe_kernel_address((unsigned short __user *)(eip + 2), + line)) break; if (__get_user(file, (char * __user *)(eip + 4)) || (unsigned long)file < PAGE_OFFSET || __get_user(c, file)) _