Переглянути джерело

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>
Nicolas Pitre 10 роки тому
батько
коміт
0f64b247e6
1 змінених файлів з 1 додано та 1 видалено
  1. 1 1
      arch/arm/lib/uaccess_with_memcpy.c

+ 1 - 1
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(&current->mm->mmap_sem);