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()
39 static bool is_ro_anon(struct vm_area_struct *vma) in is_ro_anon() argument
42 if (vma->vm_file || vma->vm_flags & VM_SHARED) in is_ro_anon()
49 if (!(vma->vm_flags & VM_WRITE) || in is_ro_anon()
50 !arch_vma_access_permitted(vma, true, false, false)) in is_ro_anon()
59 bool can_modify_vma_madv(struct vm_area_struct *vma, int behavior) in can_modify_vma_madv() argument
64 if (unlikely(!can_modify_vma(vma) && is_ro_anon(vma))) in can_modify_vma_madv()
71 static int mseal_fixup(struct vma_iterator *vmi, struct vm_area_struct *vma, in mseal_fixup() argument
76 vm_flags_t oldflags = vma->vm_flags; in mseal_fixup()
81 vma = vma_modify_flags(vmi, *prev, vma, start, end, newflags); in mseal_fixup()
82 if (IS_ERR(vma)) { in mseal_fixup()
83 ret = PTR_ERR(vma); in mseal_fixup()
87 set_vma_sealed(vma); in mseal_fixup()
89 *prev = vma; in mseal_fixup()
102 struct vm_area_struct *vma; in check_mm_seal() local
108 for_each_vma_range(vmi, vma, end) { in check_mm_seal()
109 if (vma->vm_start > nstart) in check_mm_seal()
113 if (vma->vm_end >= end) in check_mm_seal()
116 nstart = vma->vm_end; in check_mm_seal()
128 struct vm_area_struct *vma, *prev; in apply_mm_seal() local
132 vma = vma_iter_load(&vmi); in apply_mm_seal()
138 if (start > vma->vm_start) in apply_mm_seal()
139 prev = vma; in apply_mm_seal()
142 for_each_vma_range(vmi, vma, end) { in apply_mm_seal()
147 newflags = vma->vm_flags | VM_SEALED; in apply_mm_seal()
148 tmp = vma->vm_end; in apply_mm_seal()
151 error = mseal_fixup(&vmi, vma, &prev, nstart, tmp, newflags); in apply_mm_seal()