Lines Matching refs:vma

19 static inline void set_vma_sealed(struct vm_area_struct *vma)  in set_vma_sealed()  argument
21 vm_flags_set(vma, VM_SEALED); in set_vma_sealed()
40 static bool is_ro_anon(struct vm_area_struct *vma) in is_ro_anon() argument
43 if (vma->vm_file || vma->vm_flags & VM_SHARED) in is_ro_anon()
50 if (!(vma->vm_flags & VM_WRITE) || in is_ro_anon()
51 !arch_vma_access_permitted(vma, true, false, false)) in is_ro_anon()
60 bool can_modify_vma_madv(struct vm_area_struct *vma, int behavior) in can_modify_vma_madv() argument
65 if (unlikely(!can_modify_vma(vma) && is_ro_anon(vma))) in can_modify_vma_madv()
72 static int mseal_fixup(struct vma_iterator *vmi, struct vm_area_struct *vma, in mseal_fixup() argument
77 vm_flags_t oldflags = vma->vm_flags; in mseal_fixup()
82 vma = vma_modify_flags(vmi, *prev, vma, start, end, newflags); in mseal_fixup()
83 if (IS_ERR(vma)) { in mseal_fixup()
84 ret = PTR_ERR(vma); in mseal_fixup()
88 set_vma_sealed(vma); in mseal_fixup()
90 *prev = vma; in mseal_fixup()
103 struct vm_area_struct *vma; in check_mm_seal() local
109 for_each_vma_range(vmi, vma, end) { in check_mm_seal()
110 if (vma->vm_start > nstart) in check_mm_seal()
114 if (vma->vm_end >= end) in check_mm_seal()
117 nstart = vma->vm_end; in check_mm_seal()
129 struct vm_area_struct *vma, *prev; in apply_mm_seal() local
133 vma = vma_iter_load(&vmi); in apply_mm_seal()
139 if (start > vma->vm_start) in apply_mm_seal()
140 prev = vma; in apply_mm_seal()
143 for_each_vma_range(vmi, vma, end) { in apply_mm_seal()
148 newflags = vma->vm_flags | VM_SEALED; in apply_mm_seal()
149 tmp = vma->vm_end; in apply_mm_seal()
152 error = mseal_fixup(&vmi, vma, &prev, nstart, tmp, newflags); in apply_mm_seal()