Commit 0f64b247 authored by Nicolas Pitre's avatar Nicolas Pitre Committed by Russell King

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: default avatarNicolas Pitre <nico@linaro.org>
Tested-by: default avatarMark Salter <msalter@redhat.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 09edea4f
...@@ -96,7 +96,7 @@ __copy_to_user_memcpy(void __user *to, const void *from, unsigned long n) ...@@ -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 */ /* the mmap semaphore is taken only if not in an atomic context */
atomic = in_atomic(); atomic = faulthandler_disabled();
if (!atomic) if (!atomic)
down_read(&current->mm->mmap_sem); down_read(&current->mm->mmap_sem);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment