Received: by 10.213.65.68 with SMTP id h4csp17013imn; Mon, 19 Mar 2018 18:01:57 -0700 (PDT) X-Google-Smtp-Source: AG47ELujuy7Jwl7P2apIvO/R7Slg4jultgOLOMxr+reyY4mF6m0zz3vRvhCxSM3QB4623MUlBzVu X-Received: by 10.99.53.6 with SMTP id c6mr10770081pga.413.1521507716956; Mon, 19 Mar 2018 18:01:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521507716; cv=none; d=google.com; s=arc-20160816; b=k26sXo1NbPI0PBD0TgMyNvA75WbdkhM42oSlwxN7LZHTUn+qnTVOtWJ48Ag6TUWRzh BPPkkTonipVNHeFn/gJWprcQg84Qx2Ct6IeQuG8Nu4b7ubfnZFp9XDhbAubcCFX8e7rU j8YCX4kih4ig+OPr1nsGILwbiFtKC7nWG6q4rz2ENj5lVu5xprobQTP7ycZU8layVwlh iCcfUr5WOJNDaWoSXpJR8RT4Fca2ngpVg+EswTg5yBB4k5DDdWCCkKm5jwxkmpMdT4fQ /OusfPMcYpKax9YL3ImDUVghibgzMjyROec7+8gkUNrxOYbcI8Drbu7malFh51o/2PVK JO5A== 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=/cLK1tyYVf1LDWUVYlcdBvpXj6IzuUfetMWRM8O2ftE=; b=GWXzxpPl0y43fFy/uv5uwc+sr1UXFamOScV32jfEi2X4ju4oSCtBb1HjGhPstsXFhi M+/x5j4TsBLQXA8ZGIyLrHqVOh6oSDoAoErGtx8sThXtTwQXviiqcIgX/EdcAMK8n6N2 lrHYgXHDlkTaznZxkGHip0Xi/nwif6RTQkutWiL2aXkMTCncB7rtFX3q3G71VqcFQzhV Y84qTjMqKprKfUmWtuoKSg+ZdlpnPv/s6LjZpPmIsm4y9tz2ig5QytsFBNnTLKuUZ9aO MyZxUCPnUstl1ui/OcLCiSKaoeKfvS3DuInazkIRNC96Y1+f1qxNTO4odVL8v34ZCR8+ 4kyA== 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 k73si289621pgc.707.2018.03.19.18.01.42; Mon, 19 Mar 2018 18:01:56 -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 S970272AbeCSScS (ORCPT + 99 others); Mon, 19 Mar 2018 14:32:18 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:53860 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S970264AbeCSScL (ORCPT ); Mon, 19 Mar 2018 14:32:11 -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 D3C73103C; Mon, 19 Mar 2018 18:32:10 +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.15 09/52] x86/mm: Fix vmalloc_fault to use pXd_large Date: Mon, 19 Mar 2018 19:08:07 +0100 Message-Id: <20180319180735.579401608@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180734.976730813@linuxfoundation.org> References: <20180319180734.976730813@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.15-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 @@ -330,7 +330,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); @@ -475,7 +475,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); @@ -486,7 +486,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);