X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=mm%2Fmprotect.c;h=ec91dfd3f9007353acc9bc238faacac59991de3d;hb=63f53dea0c9866e93802d50a230c460a024c44e5;hp=a4830f0325fe255ef4e106bb9b982bf7a2747415;hpb=0aeeb3e73f5fd7faef3dce8cb590effd6ee51571;p=cascardo%2Flinux.git diff --git a/mm/mprotect.c b/mm/mprotect.c index a4830f0325fe..ec91dfd3f900 100644 --- a/mm/mprotect.c +++ b/mm/mprotect.c @@ -304,6 +304,7 @@ mprotect_fixup(struct vm_area_struct *vma, struct vm_area_struct **pprev, vma->vm_userfaultfd_ctx); if (*pprev) { vma = *pprev; + VM_WARN_ON((vma->vm_flags ^ newflags) & ~VM_SOFTDIRTY); goto success; } @@ -327,7 +328,7 @@ success: * held in write mode. */ vma->vm_flags = newflags; - dirty_accountable = vma_wants_writenotify(vma); + dirty_accountable = vma_wants_writenotify(vma, vma->vm_page_prot); vma_set_page_prot(vma); change_protection(vma, start, end, vma->vm_page_prot,