diff options
Diffstat (limited to 'arch/x86/lib/usercopy_64.c')
-rw-r--r-- | arch/x86/lib/usercopy_64.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/lib/usercopy_64.c b/arch/x86/lib/usercopy_64.c index f4df6e7c718b..847d12945998 100644 --- a/arch/x86/lib/usercopy_64.c +++ b/arch/x86/lib/usercopy_64.c | |||
@@ -16,6 +16,8 @@ | |||
16 | do { \ | 16 | do { \ |
17 | long __d0, __d1, __d2; \ | 17 | long __d0, __d1, __d2; \ |
18 | might_sleep(); \ | 18 | might_sleep(); \ |
19 | if (current->mm) \ | ||
20 | might_lock_read(¤t->mm->mmap_sem); \ | ||
19 | __asm__ __volatile__( \ | 21 | __asm__ __volatile__( \ |
20 | " testq %1,%1\n" \ | 22 | " testq %1,%1\n" \ |
21 | " jz 2f\n" \ | 23 | " jz 2f\n" \ |
@@ -65,6 +67,8 @@ unsigned long __clear_user(void __user *addr, unsigned long size) | |||
65 | { | 67 | { |
66 | long __d0; | 68 | long __d0; |
67 | might_sleep(); | 69 | might_sleep(); |
70 | if (current->mm) | ||
71 | might_lock_read(¤t->mm->mmap_sem); | ||
68 | /* no memory constraint because it doesn't change any memory gcc knows | 72 | /* no memory constraint because it doesn't change any memory gcc knows |
69 | about */ | 73 | about */ |
70 | asm volatile( | 74 | asm volatile( |