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 <stable@xxxxxxxxxxxxxxx> know about it. >From foo@baz Fri Sep 21 10:21:24 CEST 2018 From: Joerg Roedel <jroedel@xxxxxxx> Date: Wed, 18 Jul 2018 11:41:01 +0200 Subject: x86/mm/pti: Add an overflow check to pti_clone_pmds() From: Joerg Roedel <jroedel@xxxxxxx> [ 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. Signed-off-by: Joerg Roedel <jroedel@xxxxxxx> Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Tested-by: Pavel Machek <pavel@xxxxxx> Cc: "H . Peter Anvin" <hpa@xxxxxxxxx> Cc: linux-mm@xxxxxxxxx Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> Cc: Andy Lutomirski <luto@xxxxxxxxxx> Cc: Dave Hansen <dave.hansen@xxxxxxxxx> Cc: Josh Poimboeuf <jpoimboe@xxxxxxxxxx> Cc: Juergen Gross <jgross@xxxxxxxx> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx> Cc: Borislav Petkov <bp@xxxxxxxxx> Cc: Jiri Kosina <jkosina@xxxxxxx> Cc: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx> Cc: Brian Gerst <brgerst@xxxxxxxxx> Cc: David Laight <David.Laight@xxxxxxxxxx> Cc: Denys Vlasenko <dvlasenk@xxxxxxxxxx> Cc: Eduardo Valentin <eduval@xxxxxxxxxx> Cc: Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> Cc: Will Deacon <will.deacon@xxxxxxx> Cc: aliguori@xxxxxxxxxx Cc: daniel.gruss@xxxxxxxxxxxxxx Cc: hughd@xxxxxxxxxx Cc: keescook@xxxxxxxxxx Cc: Andrea Arcangeli <aarcange@xxxxxxxxxx> Cc: Waiman Long <llong@xxxxxxxxxx> Cc: "David H . Gutteridge" <dhgutteridge@xxxxxxxxxxxx> Cc: joro@xxxxxxxxxx Link: https://lkml.kernel.org/r/1531906876-13451-25-git-send-email-joro@xxxxxxxxxx Signed-off-by: Sasha Levin <alexander.levin@xxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- arch/x86/mm/pti.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/arch/x86/mm/pti.c +++ b/arch/x86/mm/pti.c @@ -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 jroedel@xxxxxxx 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