Received: by 10.213.65.68 with SMTP id h4csp38883imn; Mon, 19 Mar 2018 18:49:02 -0700 (PDT) X-Google-Smtp-Source: AG47ELu/mhGQQBeJ6vY7aqlHnkuyWVVvaNZVB6Y2I3miDFVLIYiXUKgaH+F9rjXrXcyGFxUftOP0 X-Received: by 10.98.57.143 with SMTP id u15mr11991788pfj.79.1521510542858; Mon, 19 Mar 2018 18:49:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521510542; cv=none; d=google.com; s=arc-20160816; b=egUQ24uXIKQgSmhivEigIP7O9xY8C1rxOoLlNBWxuDz7GIHGCz+zZkJYuYygM4+UCx wK5QYjZTeJQwwQN55GMQolvhsgBYiTTW2IJjeh0bfpkv3mLq+jXe/KuSkpnd6WOPrLer f//gdcy6idsJexbeuIbI+fl4CEhnqCkw2MMmOhQeiopXtotuaKqdGK4TUg5YrjeSGlVl l2pm/xLnnNEwgfxYYiZZQYcGb2i1pwlRzPyo9FozD0d7VWF4Vl+TRIAfLcEolzYm0oay 3pend86ZCEUaNrGRIegTkhYGHJagStoJOhb8WPke2XCKbRfLOme7ySj6OAS51IQSnf/+ Fj4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=4i37U53eyplVPdTuUIpaT7AW+G+IZomsidB1ZMcqOrc=; b=gpkxwBAGDfeeTI5lGbE9HjlXdGUzLO9Y+8H30bIEL2Lx1UYEhCn+WnEepe4SRCSg/q UQ29E1eYmpVF9T9COp8CIF2XjrwCWq1BKpjN4nWUiXE9pKE3aasfItfyNebb8eFx/007 MIE+fzFFED0s19gKzVBt12GOOBEUfMON+iK3SkHwbxvz9rglAtyPynM/6jRNl9DtP2m1 bm+8jf2JI1p19SGVa2qjbavjOugCjQfyu3rvFmtCVIdFogpdJ74m5JHr9kg6ar3/UIfF 44CSEf1yUjAwGq4nngGqqK8MevWXr8zApwkfPuCMDCTPSosz9Utz2EZyqv17W+kUL36N 5ZsA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h67si399057pgc.353.2018.03.19.18.48.49; Mon, 19 Mar 2018 18:49:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031201AbeCSUDz (ORCPT + 99 others); Mon, 19 Mar 2018 16:03:55 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45814 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S969228AbeCSSSA (ORCPT ); Mon, 19 Mar 2018 14:18:00 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 79CE51268; Mon, 19 Mar 2018 18:17:59 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Gratian Crisan , Toshi Kani , Thomas Gleixner , linux-mm@kvack.org, Borislav Petkov , Andy Lutomirski Subject: [PATCH 4.4 115/134] x86/mm: Fix vmalloc_fault to use pXd_large Date: Mon, 19 Mar 2018 19:06:38 +0100 Message-Id: <20180319171905.892026687@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319171849.024066323@linuxfoundation.org> References: <20180319171849.024066323@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Toshi Kani commit 18a955219bf7d9008ce480d4451b6b8bf4483a22 upstream. Gratian Crisan reported that vmalloc_fault() crashes when CONFIG_HUGETLBFS is not set since the function inadvertently uses pXn_huge(), which always return 0 in this case. ioremap() does not depend on CONFIG_HUGETLBFS. Fix vmalloc_fault() to call pXd_large() instead. Fixes: f4eafd8bcd52 ("x86/mm: Fix vmalloc_fault() to handle large pages properly") Reported-by: Gratian Crisan Signed-off-by: Toshi Kani Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org Cc: linux-mm@kvack.org Cc: Borislav Petkov Cc: Andy Lutomirski Link: https://lkml.kernel.org/r/20180313170347.3829-2-toshi.kani@hpe.com Signed-off-by: Greg Kroah-Hartman --- arch/x86/mm/fault.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c @@ -287,7 +287,7 @@ static noinline int vmalloc_fault(unsign if (!pmd_k) return -1; - if (pmd_huge(*pmd_k)) + if (pmd_large(*pmd_k)) return 0; pte_k = pte_offset_kernel(pmd_k, address); @@ -407,7 +407,7 @@ static noinline int vmalloc_fault(unsign if (pud_none(*pud) || pud_pfn(*pud) != pud_pfn(*pud_ref)) BUG(); - if (pud_huge(*pud)) + if (pud_large(*pud)) return 0; pmd = pmd_offset(pud, address); @@ -418,7 +418,7 @@ static noinline int vmalloc_fault(unsign if (pmd_none(*pmd) || pmd_pfn(*pmd) != pmd_pfn(*pmd_ref)) BUG(); - if (pmd_huge(*pmd)) + if (pmd_large(*pmd)) return 0; pte_ref = pte_offset_kernel(pmd_ref, address);