mmap.c (223febc6e5573cda5e94e6b38fcdaded068db777) mmap.c (40b88644dd92d99e572063893c2a247598c238d6)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * mm/mmap.c
4 *
5 * Written by obz.
6 *
7 * Address space accounting code <alan@lxorguk.ukuu.org.uk>
8 */

--- 1729 unchanged lines hidden (view full) ---

1738 */
1739int do_vma_munmap(struct vma_iterator *vmi, struct vm_area_struct *vma,
1740 unsigned long start, unsigned long end, struct list_head *uf,
1741 bool unlock)
1742{
1743 struct mm_struct *mm = vma->vm_mm;
1744
1745 /*
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * mm/mmap.c
4 *
5 * Written by obz.
6 *
7 * Address space accounting code <alan@lxorguk.ukuu.org.uk>
8 */

--- 1729 unchanged lines hidden (view full) ---

1738 */
1739int do_vma_munmap(struct vma_iterator *vmi, struct vm_area_struct *vma,
1740 unsigned long start, unsigned long end, struct list_head *uf,
1741 bool unlock)
1742{
1743 struct mm_struct *mm = vma->vm_mm;
1744
1745 /*
1746 * Check if memory is sealed before arch_unmap.
1747 * Prevent unmapping a sealed VMA.
1746 * Check if memory is sealed, prevent unmapping a sealed VMA.
1748 * can_modify_mm assumes we have acquired the lock on MM.
1749 */
1750 if (unlikely(!can_modify_mm(mm, start, end)))
1751 return -EPERM;
1752
1747 * can_modify_mm assumes we have acquired the lock on MM.
1748 */
1749 if (unlikely(!can_modify_mm(mm, start, end)))
1750 return -EPERM;
1751
1753 arch_unmap(mm, start, end);
1754 return do_vmi_align_munmap(vmi, vma, mm, start, end, uf, unlock);
1755}
1756
1757/*
1758 * do_brk_flags() - Increase the brk vma if the flags match.
1759 * @vmi: The vma iterator
1760 * @addr: The start address
1761 * @len: The length of the increase

--- 644 unchanged lines hidden ---
1752 return do_vmi_align_munmap(vmi, vma, mm, start, end, uf, unlock);
1753}
1754
1755/*
1756 * do_brk_flags() - Increase the brk vma if the flags match.
1757 * @vmi: The vma iterator
1758 * @addr: The start address
1759 * @len: The length of the increase

--- 644 unchanged lines hidden ---