+ mm-hmm-prevent-infinite-loop-in-hmm_range_fault-during-ebusy-retries.patch added to mm-hotfixes-unstable branch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: mm/hmm: prevent infinite loop in hmm_range_fault during EBUSY retries
has been added to the -mm mm-hotfixes-unstable branch.  Its filename is
     mm-hmm-prevent-infinite-loop-in-hmm_range_fault-during-ebusy-retries.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-hmm-prevent-infinite-loop-in-hmm_range_fault-during-ebusy-retries.patch

This patch will later appear in the mm-hotfixes-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days

------------------------------------------------------
From: sooraj <sooraj20636@xxxxxxxxx>
Subject: mm/hmm: prevent infinite loop in hmm_range_fault during EBUSY retries
Date: Tue, 28 Jan 2025 01:34:22 -0500

When hmm_vma_walk_test() skips a VMA (e.g., unsupported VM_IO/PFNMAP
range), it must update hmm_vma_walk->last to the end of the skipped VMA. 
Failing to do so causes hmm_range_fault() to restart from the same address
during -EBUSY retries, reprocessing the skipped VMA indefinitely.  This
results in an infinite loop if the VMA remains non-processable.

Update hmm_vma_walk->last to the VMA's end address in hmm_vma_walk_test()
when skipping the range.  This ensures subsequent iterations resume
correctly after the skipped VMA, preventing infinite retry loops.

Link: https://lkml.kernel.org/r/20250128063422.7604-1-sooraj20636@xxxxxxxxx
Signed-off-by: sooraj <sooraj20636@xxxxxxxxx>
Cc: Jason Gunthorpe <jgg@xxxxxxxxxx>
Cc: Jerome Glisse <jglisse@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/hmm.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/mm/hmm.c~mm-hmm-prevent-infinite-loop-in-hmm_range_fault-during-ebusy-retries
+++ a/mm/hmm.c
@@ -547,6 +547,8 @@ static int hmm_vma_walk_test(unsigned lo
 
 	hmm_pfns_fill(start, end, range, HMM_PFN_ERROR);
 
+	/* Update last to the end of the skipped VMA to prevent reprocessing */
+	hmm_vma_walk->last = end;
 	/* Skip this vma and continue processing the next vma. */
 	return 1;
 }
_

Patches currently in -mm which might be from sooraj20636@xxxxxxxxx are

mm-hmm-prevent-infinite-loop-in-hmm_range_fault-during-ebusy-retries.patch





[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux