Skip to contentSkip to conversation

mm-pagewalk-fix-termination-condition-in-walk_pte_range.patch removed from -mm tree

merged [email protected] 1 participant 1 message Feb 4, 2020

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: mm: pagewalk: fix termination condition in walk_pte_range()
has been removed from the -mm tree. Its filename was
mm-pagewalk-fix-termination-condition-in-walk_pte_range.patch

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

------------------------------------------------------
From: Steven Price <[email protected]>
Subject: mm: pagewalk: fix termination condition in walk_pte_range()

If walk_pte_range() is called with a 'end' argument that is beyond the last page of memory (e.g. ~0UL) then the comparison between 'addr' and 'end' will always fail and the loop will be infinite. Instead change the comparison to >= while accounting for overflow.

Cc Albert Ou <[email protected]>
Cc Alexandre Ghiti <[email protected]>
Cc Andy Lutomirski <[email protected]>
Cc Ard Biesheuvel <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Benjamin Herrenschmidt <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Catalin Marinas <[email protected]>
Cc Christian Borntraeger <[email protected]>
Cc Dave Hansen <[email protected]>
Cc David S. Miller <[email protected]>
Cc Heiko Carstens <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc James Hogan <[email protected]>
Cc James Morse <[email protected]>
Cc Jerome Glisse <[email protected]>
Cc "Liang, Kan" <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Michael Ellerman <[email protected]>
Cc Paul Burton <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Paul Walmsley <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Ralf Baechle <[email protected]>
Cc Russell King <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Vasily Gorbik <[email protected]>
Cc Vineet Gupta <[email protected]>
Cc Will Deacon <[email protected]>
Cc Zong Li <[email protected]>

---

 mm/pagewalk.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
mm/pagewalk.c renamed from mm/pagewalk.c~mm-pagewalk-fix-termination-condition-in-walk_pte_range +2 -2
@@ -14,9 +14,9 @@ static int walk_pte_range_inner(pte_t *p
 		err = ops->pte_entry(pte, addr, addr + PAGE_SIZE, walk);
 		if (err)
 		       break;
-		addr += PAGE_SIZE;
-		if (addr == end)
+		if (addr >= end - PAGE_SIZE)
 			break;
+		addr += PAGE_SIZE;
 		pte++;
 	}
 	return err;

_

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