Skip to contentSkip to conversation

mm-migrate-fix-indexing-bug-off-by-one-and-avoid-out-of-bound-access.patch removed from -mm tree

merged [email protected] 1 participant 1 message Oct 16, 2017

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: mm/migrate: fix indexing bug (off by one) and avoid out of bound access
has been removed from the -mm tree. Its filename was
mm-migrate-fix-indexing-bug-off-by-one-and-avoid-out-of-bound-access.patch

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

------------------------------------------------------
From: Mark Hairgrove <[email protected]>
Subject: mm/migrate: fix indexing bug (off by one) and avoid out of bound access

Index was incremented before last use and thus the second array could dereference to an invalid address (not mentioning the fact that it did not properly clear the entry we intended to clear).

Fixes 8315ada7f095bf ("mm/migrate: allow migrate_vma() to alloc new page on empty entry")
Cc Reza Arbab <[email protected]>

---

 mm/migrate.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
mm/migrate.c renamed from mm/migrate.c~mm-migrate-fix-indexing-bug-off-by-one-and-avoid-out-of-bound-access +2 -1
diff -puN mm/migrate.c~mm-migrate-fix-indexing-bug-off-by-one-and-avoid-out-of-bound-access mm/migrate.c
@@ -2146,8 +2146,9 @@ static int migrate_vma_collect_hole(unsi
 	unsigned long addr;
 
 	for (addr = start & PAGE_MASK; addr < end; addr += PAGE_SIZE) {
-		migrate->src[migrate->npages++] = MIGRATE_PFN_MIGRATE;
+		migrate->src[migrate->npages] = MIGRATE_PFN_MIGRATE;
 		migrate->dst[migrate->npages] = 0;
+		migrate->npages++;
 		migrate->cpages++;
 	}
 

_

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