Received: by 10.213.65.68 with SMTP id h4csp1740716imn; Mon, 19 Mar 2018 11:59:42 -0700 (PDT) X-Google-Smtp-Source: AG47ELuB30/fM2yMc3EiXIaHUEsp+FoYa2S8atFYoJuW7u0e+1s4poED1ac+io0FJNs/Sh7Fdwb4 X-Received: by 2002:a17:902:127:: with SMTP id 36-v6mr13598118plb.194.1521485982922; Mon, 19 Mar 2018 11:59:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521485982; cv=none; d=google.com; s=arc-20160816; b=lS1ai9gECROsT7jh+biqFy8Yws5M+H3FWeakQIj7d6GLYzxFHjIpWsqnZE+CVqfSvw oiVQOnlybaiwQDanmFUXAXSdsC8rRluy1qFRUDz7N9adCpDhGx8XhctxIHpKmHWLPTmC hU3DQcVS2Y+DwDxcowsWIaVaBMlGA4v1fhAIy45zokvNOYhACLyfiN680oc9iIqGZhts hb1dhbcPkW9bLcPYhG7RZay1cRriDP8b9HWik/cgRGuUqBM5qNcICnquk6ST1mDCMWrk NL+bo2bexevvs5rT5i/cALrtzRx1L6LYyau2SeHmXxzBofvL/NhzXaAiIH9j/5mbi9lQ DSZg== 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=bO38c7AeD4qwKnXA7BvTis2gQL7QZtueGOFrh4A0Ulk=; b=YelMEh2Z8bokoqqoZY2e7NWNbA8gZ67pO7+pJtWQUb24MeB3nezSM1tv6cHRAxdejH JCYlz/T5J1RY9KmRgPGmjCPGizB9dH9rFqSxjU5g9qXNDvy7BUST/Zcz535tCPlStHeL tfbP2KI81FeicHiZIaqjiUJlnWhxG0iORdlq6LAm8upgCWj45+hW4/JA0Qjprs0SBCAw Pnv0asYltG8OO9/JKuEmVDEizKH1pLyTjCrMTtfG2euKCPg4w6jh44XLVn3NwtFBT4pa I9k1pH4FUugS7Lf6nuciu8U2pJv9WrYIhrKYOXjouSQLr7dXWCgdSc6V1/IRAN7nd8km 6cJg== 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 k73si331280pge.131.2018.03.19.11.59.28; Mon, 19 Mar 2018 11:59:42 -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 S935284AbeCSS3c (ORCPT + 99 others); Mon, 19 Mar 2018 14:29:32 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:52686 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967819AbeCSS3Q (ORCPT ); Mon, 19 Mar 2018 14:29:16 -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 D1CA41139; Mon, 19 Mar 2018 18:29:15 +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.14 11/41] x86/mm: Fix vmalloc_fault to use pXd_large Date: Mon, 19 Mar 2018 19:08:11 +0100 Message-Id: <20180319180732.937782326@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180732.195217948@linuxfoundation.org> References: <20180319180732.195217948@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.14-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); @@ -479,7 +479,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); @@ -490,7 +490,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);