RISC-V: Fix wrong use of CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK
[platform/kernel/linux-rpi.git] / mm / gup.c
index 948f3b4..2f8a2d8 100644 (file)
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -1051,7 +1051,7 @@ static int check_vma_flags(struct vm_area_struct *vma, unsigned long gup_flags)
                    !writable_file_mapping_allowed(vma, gup_flags))
                        return -EFAULT;
 
-               if (!(vm_flags & VM_WRITE)) {
+               if (!(vm_flags & VM_WRITE) || (vm_flags & VM_SHADOW_STACK)) {
                        if (!(gup_flags & FOLL_FORCE))
                                return -EFAULT;
                        /* hugetlb does not support FOLL_FORCE|FOLL_WRITE. */