diff options
author | Nicolas Pitre <nicolas.pitre@linaro.org> | 2015-08-12 11:45:02 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2015-08-18 08:59:59 -0400 |
commit | 0f64b247e63ac8c214efa6725366b42563ab138c (patch) | |
tree | b328dc3eed4838935cebba95bba93b5946ca82a3 | |
parent | 09edea4f8fdeb4e292b80d493296070f5ec64e6e (diff) |
ARM: 8414/1: __copy_to_user_memcpy: fix mmap semaphore usage
The mmap semaphore should not be taken when page faults are disabled.
Since pagefault_disable() no longer disables preemption, we now need
to use faulthandler_disabled() in place of in_atomic().
Signed-off-by: Nicolas Pitre <nico@linaro.org>
Tested-by: Mark Salter <msalter@redhat.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/lib/uaccess_with_memcpy.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/lib/uaccess_with_memcpy.c b/arch/arm/lib/uaccess_with_memcpy.c index 3e58d710013c..4b39af2dfda9 100644 --- a/arch/arm/lib/uaccess_with_memcpy.c +++ b/arch/arm/lib/uaccess_with_memcpy.c | |||
@@ -96,7 +96,7 @@ __copy_to_user_memcpy(void __user *to, const void *from, unsigned long n) | |||
96 | } | 96 | } |
97 | 97 | ||
98 | /* the mmap semaphore is taken only if not in an atomic context */ | 98 | /* the mmap semaphore is taken only if not in an atomic context */ |
99 | atomic = in_atomic(); | 99 | atomic = faulthandler_disabled(); |
100 | 100 | ||
101 | if (!atomic) | 101 | if (!atomic) |
102 | down_read(¤t->mm->mmap_sem); | 102 | down_read(¤t->mm->mmap_sem); |