Skip to contentSkip to conversation

Patch "x86/mm/pti: Add an overflow check to pti_clone_pmds()" has been added to the 4.18-stable tree

PATCH [email protected] 1 participant 1 message Sep 21, 2018

Subsystems (3)
lore
Share & tools
lore

[email protected]

author Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

x86/mm/pti: Add an overflow check to pti_clone_pmds()

to the 4.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
x86-mm-pti-add-an-overflow-check-to-pti_clone_pmds.patch
and it can be found in the queue-4.18 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Fri Sep 21 10:21:24 CEST 2018

From: Joerg Roedel <[email protected]>
Date: Wed, 18 Jul 2018 11:41:01 +0200
Subject: x86/mm/pti: Add an overflow check to pti_clone_pmds()

From: Joerg Roedel <[email protected]>

[ Upstream commit 935232ce28dfabff1171e5a7113b2d865fa9ee63 ]

The addr counter will overflow if the last PMD of the address space is cloned, resulting in an endless loop.

Check for that and bail out of the loop when it happens.

Cc "H . Peter Anvin" <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Andy Lutomirski <[email protected]>
Cc Dave Hansen <[email protected]>
Cc Josh Poimboeuf <[email protected]>
Cc Juergen Gross <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Jiri Kosina <[email protected]>
Cc Boris Ostrovsky <[email protected]>
Cc Brian Gerst <[email protected]>
Cc David Laight <[email protected]>
Cc Denys Vlasenko <[email protected]>
Cc Eduardo Valentin <[email protected]>
Cc Greg KH <[email protected]>
Cc Will Deacon <[email protected]>
Cc Andrea Arcangeli <[email protected]>
Cc Waiman Long <[email protected]>
Cc "David H . Gutteridge" <[email protected]>
---
 arch/x86/mm/pti.c |    4 ++++
 1 file changed, 4 insertions(+)
arch/x86/mm/pti.c +4 -0
@@ -306,6 +306,10 @@ pti_clone_pmds(unsigned long start, unsi
 		p4d_t *p4d;
 		pud_t *pud;
 
+		/* Overflow check */
+		if (addr < start)
+			break;
+
 		pgd = pgd_offset_k(addr);
 		if (WARN_ON(pgd_none(*pgd)))
 			return;

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

queue-4.18/iommu-ipmmu-vmsa-imuctrn.ttsel-needs-a-special-usage-on-r-car-gen3.patch queue-4.18/x86-mm-pti-add-an-overflow-check-to-pti_clone_pmds.patch