Signed-off-by: Liam R. Howlett <[email protected]>
---
 kernel/sys.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/sys.c b/kernel/sys.c
index a730c03ee607c..fe061c54a5a46 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -1858,9 +1858,10 @@ static int prctl_set_mm_exe_file(struct mm_struct *mm, 
unsigned int fd)
        err = -EBUSY;
        if (exe_file) {
                struct vm_area_struct *vma;
+               MA_STATE(mas, &mm->mm_mt, 0, 0);
 
                mmap_read_lock(mm);
-               for (vma = mm->mmap; vma; vma = vma->vm_next) {
+               mas_for_each(&mas, vma, ULONG_MAX) {
                        if (!vma->vm_file)
                                continue;
                        if (path_equal(&vma->vm_file->f_path,
-- 
2.28.0

Reply via email to