Skip to contentSkip to conversation

mm-mremap-fix-extent-calculation.patch removed from -mm tree

merged [email protected] 1 participant 1 message Dec 31, 2020

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: mm/mremap.c: fix extent calculation
has been removed from the -mm tree. Its filename was
mm-mremap-fix-extent-calculation.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Kalesh Singh <[email protected]>
Subject: mm/mremap.c: fix extent calculation

When next < old_addr, next - old_addr arithmetic underflows causing extent to be incorrect.

Make extent the smaller of next - old_addr or old_end - old_addr.

Fixes c49dd34018026 ("mm: speedup mremap on 1GB or larger regions")
Cc Suren Baghdasaryan <[email protected]>
Cc Minchan Kim <[email protected]>
Cc Lokesh Gidra <[email protected]>
Cc Helge Deller <[email protected]>
Cc Kalesh Singh <[email protected]>
Cc "Kirill A. Shutemov" <[email protected]>

---

 mm/mremap.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
mm/mremap.c renamed from mm/mremap.c~mm-mremap-fix-extent-calculation +3 -1
@@ -358,7 +358,9 @@ static unsigned long get_extent(enum pgt
 
 	next = (old_addr + size) & mask;
 	/* even if next overflowed, extent below will be ok */
-	extent = (next > old_end) ? old_end - old_addr : next - old_addr;
+	extent = next - old_addr;
+	if (extent > old_end - old_addr)
+		extent = old_end - old_addr;
 	next = (new_addr + size) & mask;
 	if (extent > next - new_addr)
 		extent = next - new_addr;

_

Patches currently in -mm which might be from [email protected] are