summaryrefslogtreecommitdiffstats
path: root/mm/memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/memory.c')
-rw-r--r--mm/memory.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mm/memory.c b/mm/memory.c
index 85e7a87da79f..5eb3d2524bdc 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -3948,7 +3948,7 @@ static int handle_pte_fault(struct vm_fault *vmf)
3948 if (unlikely(!pte_same(*vmf->pte, entry))) 3948 if (unlikely(!pte_same(*vmf->pte, entry)))
3949 goto unlock; 3949 goto unlock;
3950 if (vmf->flags & FAULT_FLAG_WRITE) { 3950 if (vmf->flags & FAULT_FLAG_WRITE) {
3951 if (!pte_write(entry)) 3951 if (!pte_access_permitted(entry, WRITE))
3952 return do_wp_page(vmf); 3952 return do_wp_page(vmf);
3953 entry = pte_mkdirty(entry); 3953 entry = pte_mkdirty(entry);
3954 } 3954 }
@@ -4013,7 +4013,7 @@ static int __handle_mm_fault(struct vm_area_struct *vma, unsigned long address,
4013 4013
4014 /* NUMA case for anonymous PUDs would go here */ 4014 /* NUMA case for anonymous PUDs would go here */
4015 4015
4016 if (dirty && !pud_write(orig_pud)) { 4016 if (dirty && !pud_access_permitted(orig_pud, WRITE)) {
4017 ret = wp_huge_pud(&vmf, orig_pud); 4017 ret = wp_huge_pud(&vmf, orig_pud);
4018 if (!(ret & VM_FAULT_FALLBACK)) 4018 if (!(ret & VM_FAULT_FALLBACK))
4019 return ret; 4019 return ret;
@@ -4046,7 +4046,7 @@ static int __handle_mm_fault(struct vm_area_struct *vma, unsigned long address,
4046 if (pmd_protnone(orig_pmd) && vma_is_accessible(vma)) 4046 if (pmd_protnone(orig_pmd) && vma_is_accessible(vma))
4047 return do_huge_pmd_numa_page(&vmf, orig_pmd); 4047 return do_huge_pmd_numa_page(&vmf, orig_pmd);
4048 4048
4049 if (dirty && !pmd_write(orig_pmd)) { 4049 if (dirty && !pmd_access_permitted(orig_pmd, WRITE)) {
4050 ret = wp_huge_pmd(&vmf, orig_pmd); 4050 ret = wp_huge_pmd(&vmf, orig_pmd);
4051 if (!(ret & VM_FAULT_FALLBACK)) 4051 if (!(ret & VM_FAULT_FALLBACK))
4052 return ret; 4052 return ret;
@@ -4336,7 +4336,7 @@ int follow_phys(struct vm_area_struct *vma,
4336 goto out; 4336 goto out;
4337 pte = *ptep; 4337 pte = *ptep;
4338 4338
4339 if ((flags & FOLL_WRITE) && !pte_write(pte)) 4339 if (!pte_access_permitted(pte, flags & FOLL_WRITE))
4340 goto unlock; 4340 goto unlock;
4341 4341
4342 *prot = pgprot_val(pte_pgprot(pte)); 4342 *prot = pgprot_val(pte_pgprot(pte));