mirror of
https://github.com/adulau/aha.git
synced 2025-01-03 14:43:17 +00:00
[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>
This commit is contained in:
parent
1b79e5513d
commit
1e2af92e08
1 changed files with 4 additions and 3 deletions
|
@ -28,6 +28,7 @@
|
||||||
#include <linux/kprobes.h>
|
#include <linux/kprobes.h>
|
||||||
#include <linux/kexec.h>
|
#include <linux/kexec.h>
|
||||||
#include <linux/unwind.h>
|
#include <linux/unwind.h>
|
||||||
|
#include <linux/uaccess.h>
|
||||||
|
|
||||||
#ifdef CONFIG_EISA
|
#ifdef CONFIG_EISA
|
||||||
#include <linux/ioport.h>
|
#include <linux/ioport.h>
|
||||||
|
@ -40,7 +41,6 @@
|
||||||
|
|
||||||
#include <asm/processor.h>
|
#include <asm/processor.h>
|
||||||
#include <asm/system.h>
|
#include <asm/system.h>
|
||||||
#include <asm/uaccess.h>
|
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
#include <asm/atomic.h>
|
#include <asm/atomic.h>
|
||||||
#include <asm/debugreg.h>
|
#include <asm/debugreg.h>
|
||||||
|
@ -409,7 +409,7 @@ static void handle_BUG(struct pt_regs *regs)
|
||||||
|
|
||||||
if (eip < PAGE_OFFSET)
|
if (eip < PAGE_OFFSET)
|
||||||
return;
|
return;
|
||||||
if (__get_user(ud2, (unsigned short __user *)eip))
|
if (probe_kernel_address((unsigned short __user *)eip, ud2))
|
||||||
return;
|
return;
|
||||||
if (ud2 != 0x0b0f)
|
if (ud2 != 0x0b0f)
|
||||||
return;
|
return;
|
||||||
|
@ -422,7 +422,8 @@ static void handle_BUG(struct pt_regs *regs)
|
||||||
char *file;
|
char *file;
|
||||||
char c;
|
char c;
|
||||||
|
|
||||||
if (__get_user(line, (unsigned short __user *)(eip + 2)))
|
if (probe_kernel_address((unsigned short __user *)(eip + 2),
|
||||||
|
line))
|
||||||
break;
|
break;
|
||||||
if (__get_user(file, (char * __user *)(eip + 4)) ||
|
if (__get_user(file, (char * __user *)(eip + 4)) ||
|
||||||
(unsigned long)file < PAGE_OFFSET || __get_user(c, file))
|
(unsigned long)file < PAGE_OFFSET || __get_user(c, file))
|
||||||
|
|
Loading…
Reference in a new issue