parisc: Extend disabled preemption in copy_user_page
authorJohn David Anglin <dave.anglin@bell.net>
Tue, 25 Jul 2017 21:23:35 +0000 (17:23 -0400)
committerHelge Deller <deller@gmx.de>
Tue, 25 Jul 2017 21:36:54 +0000 (23:36 +0200)
It's always bothered me that we only disable preemption in
copy_user_page around the call to flush_dcache_page_asm.
This patch extends this to after the copy.

Signed-off-by: John David Anglin <dave.anglin@bell.net>
Cc: stable@vger.kernel.org # 4.9+
Signed-off-by: Helge Deller <deller@gmx.de>
arch/parisc/kernel/cache.c

index 3a64ebb39ac71b883993939589da4e746d04e54c..85a92db70afc99ab9151924823a3e277f1c0e8c5 100644 (file)
@@ -453,8 +453,8 @@ void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
          before it can be accessed through the kernel mapping. */
        preempt_disable();
        flush_dcache_page_asm(__pa(vfrom), vaddr);
-       preempt_enable();
        copy_page_asm(vto, vfrom);
+       preempt_enable();
 }
 EXPORT_SYMBOL(copy_user_page);