diff options
author | Peter Zijlstra <peterz@infradead.org> | 2009-01-29 10:02:12 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-29 10:03:34 -0500 |
commit | 010060741ad35eacb504414bc6fb9bb575b15f62 (patch) | |
tree | 91c9a6f497e6a03635e73386bbce50cd56cfcacb /arch/x86/mm/fault.c | |
parent | fb746d0e1365b7472ccc4c3d5b0672b34a092d0b (diff) |
x86: add might_sleep() to do_page_fault()
Impact: widen debug checks
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@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/mm/fault.c')
-rw-r--r-- | arch/x86/mm/fault.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index 8f4b859a04b3..eb4d7fe05938 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c | |||
@@ -888,6 +888,12 @@ void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code) | |||
888 | return; | 888 | return; |
889 | } | 889 | } |
890 | down_read(&mm->mmap_sem); | 890 | down_read(&mm->mmap_sem); |
891 | } else { | ||
892 | /* | ||
893 | * The above down_read_trylock() might have succeeded in which | ||
894 | * case we'll have missed the might_sleep() from down_read(). | ||
895 | */ | ||
896 | might_sleep(); | ||
891 | } | 897 | } |
892 | 898 | ||
893 | vma = find_vma(mm, address); | 899 | vma = find_vma(mm, address); |