From: Nicolas Pitre Date: Wed, 12 Aug 2015 15:45:02 +0000 (+0100) Subject: ARM: 8414/1: __copy_to_user_memcpy: fix mmap semaphore usage X-Git-Tag: v4.2-rc8~4^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0f64b247e63ac8c214efa6725366b42563ab138c;p=profile%2Fcommon%2Fplatform%2Fkernel%2Flinux-artik7.git 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 Tested-by: Mark Salter Signed-off-by: Russell King --- diff --git a/arch/arm/lib/uaccess_with_memcpy.c b/arch/arm/lib/uaccess_with_memcpy.c index 3e58d71..4b39af2 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) } /* the mmap semaphore is taken only if not in an atomic context */ - atomic = in_atomic(); + atomic = faulthandler_disabled(); if (!atomic) down_read(¤t->mm->mmap_sem);