Skip to content

Commit 0f64b24

Browse files
Nicolas PitreRussell King
authored andcommitted
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 <[email protected]> Tested-by: Mark Salter <[email protected]> Signed-off-by: Russell King <[email protected]>
1 parent 09edea4 commit 0f64b24

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/arm/lib/uaccess_with_memcpy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ __copy_to_user_memcpy(void __user *to, const void *from, unsigned long n)
9696
}
9797

9898
/* the mmap semaphore is taken only if not in an atomic context */
99-
atomic = in_atomic();
99+
atomic = faulthandler_disabled();
100100

101101
if (!atomic)
102102
down_read(&current->mm->mmap_sem);

0 commit comments

Comments
 (0)