[PATCH] x86: add might_sleep() to do_page_fault()

From: Peter Zijlstra
Date: Thu Jan 29 2009 - 09:57:13 EST


VirtualBox calls do_page_fault() from an atomic context but runs into a
might_sleep() way pas this point, cure that.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
---
arch/x86/mm/fault.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index 67e4df5..bb7f946 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -908,6 +908,11 @@ void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code)
}
down_read(&mm->mmap_sem);
}
+ /*
+ * The above down_read_trylock() might have succeeded in which case
+ * we'll have missed the might_sleep() from down_read().
+ */
+ might_sleep();

vma = find_vma(mm, address);
if (unlikely(!vma)) {


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/