Received: by 10.213.65.68 with SMTP id h4csp21979imn; Mon, 19 Mar 2018 18:12:23 -0700 (PDT) X-Google-Smtp-Source: AG47ELulhxbH8ZIPR+9mT5HZsZfd9Nn+QLcS0zgDsBcUS12xBlDaIIbPdPtWviNq+qnek29tEq+w X-Received: by 10.98.97.1 with SMTP id v1mr12073311pfb.119.1521508343887; Mon, 19 Mar 2018 18:12:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521508343; cv=none; d=google.com; s=arc-20160816; b=A3mjcXRBt8CrCkWMsNzKQcIiaFSzWn6xzVTsnWEF0Mui/IrBG7/I4gyNhnCzceAytg yNJC2ocMAtYFSouEKR4aY4d/qIcrq1CDcqg4B12uzbauJ9k3FrmZ3DIGQouSVdR4tlSa ucwLYF5WdUngLfh/Cx5igmyMY7NVK3qhGEu3y63N6C+Y03xFwqTsQT6mRhbx7rpi80iZ 6YPAr1GXImocZvA/5+AteAXxkz2spZXQ6Db1EL0wlz9YPcIVoYoxRw1tTHvx0Ve0Iq8z hVPTbNWmbZZszQnO+Q01zvbHpuX9dsMNTbFO3yrWHaoYL/cwCcHg2HkYm4yvcic1Ytj2 Uwvg== 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=XgKZb0fM4/p6HJuXCbHMORKu9Mopv4fzqB1yu/CeGSM=; b=EPjlNVmghWy6p7o3OXHDIYakjcFJwJhz3cOBP2ZZo/LCNhZHIvEd6EWUZFOTPwcFuu Vt5sEbE3LBPLPjezAPITYQemJ11QrNcgP6z0LE3W4wvHbWGkKrJaRQ+CeSFSSKyuB63F qdZ0B9sgVUmxdSs9DQW8VW7WsndGlb6UfWTZPI7MDf63OIh7KOBMZ83plZ+c+LxcVEUQ 7y3rnkUnbKMI6kI0ANqJ0M1pH4LTESK7026rjyQNAfzj2hQS+ObKBxzOviZRpwTZ62zI 6GCcDDR0k06mAczoYEwyxM2r2i7i2MHp+9b35kY9sYlADGOH815Mu6xVZ2Qj2mN7rv9k 4plA== 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 r59-v6si471574plb.69.2018.03.19.18.12.10; Mon, 19 Mar 2018 18:12:23 -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 S970628AbeCSTAv (ORCPT + 99 others); Mon, 19 Mar 2018 15:00:51 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:52500 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S969966AbeCSS25 (ORCPT ); Mon, 19 Mar 2018 14:28:57 -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 4B5EA10DC; Mon, 19 Mar 2018 18:28:56 +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.9 220/241] x86/mm: Fix vmalloc_fault to use pXd_large Date: Mon, 19 Mar 2018 19:08:05 +0100 Message-Id: <20180319180800.282731338@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180751.172155436@linuxfoundation.org> References: <20180319180751.172155436@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.9-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 @@ -343,7 +343,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); @@ -463,7 +463,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); @@ -474,7 +474,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);