Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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(&current->mm->mmap_sem);