From patchwork Fri Sep 21 07:53:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 10609247 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9EB5D5A4 for ; Fri, 21 Sep 2018 08:04:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8EE5628E70 for ; Fri, 21 Sep 2018 08:04:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 80F6C2DB78; Fri, 21 Sep 2018 08:04:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E9F9A28E70 for ; Fri, 21 Sep 2018 08:04:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 80C1E8E0002; Fri, 21 Sep 2018 04:04:26 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 7BBD18E0001; Fri, 21 Sep 2018 04:04:26 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6D1B68E0002; Fri, 21 Sep 2018 04:04:26 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by kanga.kvack.org (Postfix) with ESMTP id 308E88E0001 for ; Fri, 21 Sep 2018 04:04:26 -0400 (EDT) Received: by mail-pg1-f197.google.com with SMTP id e124-v6so5361556pgc.11 for ; Fri, 21 Sep 2018 01:04:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:subject:to:cc :from:date:message-id:mime-version:content-transfer-encoding; bh=4THs9h92fApmADdDn08to4wt35vFNeg59NMOQmsDgq8=; b=TG9e2OURhTawNYi01GLkfbbnpSFIugbL33AsxDD+OYpwVnkPfG+se3gzlEbrTVU6EP NXfMM8DMSPy8gFElWN9irObuxJm/s2672l2sV7fz0oB8Ly4Jd24QKWZIA0kJwoAVmPoM cpjkLu/+WFw5HYRHo2dGXaVR/NWw/G454S3xj9OtxLJps7zNAJHVhnCvmF0Uo+Ac/Hzb b6+3jAJ6pQ98iNAIbknJCTzcCoP1cpV1ujjVSRxQyZFl40kTZBEGVsENSu2NOA22OZJh 4qoEtPKpRsbIV2XJX9LGTuDTRdQkXFXEyJ0OODof/NOeei/mNRTsm+Vpxp8e5gy5kCTK 8OwA== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of gregkh@linuxfoundation.org designates 140.211.169.12 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org X-Gm-Message-State: APzg51AGUQoAVPtv1BOfh9sBiSmNSKboHtGQEZgueVXdwyvbkss/vjWE 6EKNbd5XOyAnk1/xDvUQQSUx3FzoKId0R+cMxeLptkNfaowZ2E8q69uAmP1joHdejGVprTkFX0F VPzQRbWEqvkCPFQ0TFLS2jeaUKsYZ3jNj7z8fgRcxy6grSc7CJ3ycWlkeIDicne5ScA== X-Received: by 2002:a63:fd52:: with SMTP id m18-v6mr40392540pgj.304.1537517065857; Fri, 21 Sep 2018 01:04:25 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZEcrBe/fi9UOvMi4MTm4pFkJWYT8z+/LBT6Wd0BB2TQ6yiSFG0x2Hlf6suPLHR5XIpce5L X-Received: by 2002:a63:fd52:: with SMTP id m18-v6mr40392457pgj.304.1537517064754; Fri, 21 Sep 2018 01:04:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537517064; cv=none; d=google.com; s=arc-20160816; b=P3MBMrAXWYUZJqLibAqrw74ea7PkdiehmNFJl4726ph+ZqJ0azcEslzNbEhkIHAyMl IDvBpXet365Gxe2o66HJJzAj1r644FTIydQyyW6+h3sayhkxt/h7jbMMzT9yUKpMYe5i PEJGtref1WuibD6ISihQDhQRQwc1/beEgPgpmXNSn1m9Ko32iuLHBj/imbPw1VcfHpLC 8rATQO1eHtoq/ZRUQWGJ1/+JFLoxxrPR/VKYGZukLAkbtOsLrUOJJ9mC1KfGSIYTkLzE XvHFUfmLIiS5xTCwnDMduFOt7ov5I8EcS/48TwI1jX+m9OpnZ16QY/IoatHSgCgQFJwX Pn0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:from:cc:to :subject; bh=4THs9h92fApmADdDn08to4wt35vFNeg59NMOQmsDgq8=; b=al41l+7FcQzV3ZMJm/4ELS4zUTMYZoRhS44MUqD9Edbxx3IUDnN/HcEBEoaoA8+qmZ WqKHVypfv+wSSWYBf4a6N9W8rWIroFhEOrybQ5Z+XrrMDkOfc70g/Bb08Rdi1mb7YJyS 7nDANud6xssQiOVgA1cRtZOxHi0DYBXk19GLyVgV0FZEbcIzFHNAwr8o39PSEeAo/zzP qNo24CQfvQ13sXUizCbZxvIPG7rp+/OX7SCj8PS6izuPi+hWUhgdIx8X3AVNm7mV12vQ f0j1IL5OdH/vUlIbTM66aSRAVuvxJIj1NLe8TKIqY6JK3p4hbQCGOgI7V9ySzre9TMNJ PQMQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gregkh@linuxfoundation.org designates 140.211.169.12 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org. [140.211.169.12]) by mx.google.com with ESMTPS id e11-v6si25366702pga.150.2018.09.21.01.04.24 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Sep 2018 01:04:24 -0700 (PDT) Received-SPF: pass (google.com: domain of gregkh@linuxfoundation.org designates 140.211.169.12 as permitted sender) client-ip=140.211.169.12; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gregkh@linuxfoundation.org designates 140.211.169.12 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org Received: from localhost (unknown [37.170.50.219]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 6ADACD29; Fri, 21 Sep 2018 08:04:23 +0000 (UTC) Subject: Patch "x86/mm/pti: Add an overflow check to pti_clone_pmds()" has been added to the 4.14-stable tree To: 1531906876-13451-25-git-send-email-joro@8bytes.org,David.Laight@aculab.com,aarcange@redhat.com,alexander.levin@microsoft.com,aliguori@amazon.com,boris.ostrovsky@oracle.com,bp@alien8.de,brgerst@gmail.com,daniel.gruss@iaik.tugraz.at,dave.hansen@intel.com,dhgutteridge@sympatico.ca,dvlasenk@redhat.com,eduval@amazon.com,gregkh@linuxfoundation.org,hpa@zytor.com,hughd@google.com,jgross@suse.com,jkosina@suse.cz,joro@8bytes.org,jpoimboe@redhat.com,jroedel@suse.de,keescook@google.com,linux-mm@kvack.org,llong@redhat.com,luto@kernel.org,pavel@ucw.cz,peterz@infradead.org,tglx@linutronix.de,torvalds@linux-foundation.org,will.deacon@arm.com Cc: From: Date: Fri, 21 Sep 2018 09:53:31 +0200 Message-ID: <153751641157178@kroah.com> MIME-Version: 1.0 X-stable: commit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP 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.14-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.14 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. From foo@baz Fri Sep 21 09:51:45 CEST 2018 From: Joerg Roedel Date: Wed, 18 Jul 2018 11:41:01 +0200 Subject: x86/mm/pti: Add an overflow check to pti_clone_pmds() From: Joerg Roedel [ 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 Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-25-git-send-email-joro@8bytes.org Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/x86/mm/pti.c | 4 ++++ 1 file changed, 4 insertions(+) Patches currently in stable-queue which might be from jroedel@suse.de are queue-4.14/x86-mm-pti-add-an-overflow-check-to-pti_clone_pmds.patch --- a/arch/x86/mm/pti.c +++ b/arch/x86/mm/pti.c @@ -291,6 +291,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;