From: Andrew Morton Date: Wed, 27 Sep 2006 08:51:15 +0000 (-0700) Subject: [PATCH] x86: use probe_kernel_address in handle_BUG() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1e2af92e089d4c845248844a3e7ee06ce889af46;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [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 Signed-off-by: Linus Torvalds --- 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 @@ #include #include #include +#include #ifdef CONFIG_EISA #include @@ -40,7 +41,6 @@ #include #include -#include #include #include #include @@ -409,7 +409,7 @@ static void handle_BUG(struct pt_regs *regs) 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; @@ -422,7 +422,8 @@ static void handle_BUG(struct pt_regs *regs) 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))