Received: by 10.213.65.68 with SMTP id h4csp1195453imn; Wed, 14 Mar 2018 12:30:16 -0700 (PDT) X-Google-Smtp-Source: AG47ELsPcXnrksO26oOaC5BTnx2HMhYCOLZdJKG7u5fIYn64s+RdgMtg/HPfJNsXYKyC9tGREA2W X-Received: by 10.99.114.86 with SMTP id c22mr2454118pgn.72.1521055816134; Wed, 14 Mar 2018 12:30:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521055816; cv=none; d=google.com; s=arc-20160816; b=cCOILbZGN5L212DT4Q3Qg4P/pAYL+OeAiSU6z0QFVZmuWlgJrABcKM9x0mUT0syi8Z MC8+uO2pNSGLk67f2hqa5NiqYkKRVvWfCrpy2taXXvRKQZ6+I9S2pAARforyLzET88if 6I57OV0epmKd5E+UCjqmqg5PoWs+E39ueMgAYy6NAIB1LuCnYMxU/WixSsDxTbXtDWl7 KlfI58DIn0cY0I42j/sWoNIsM4UqO/RhNlv+oyDIvRcLoADJqE9TLpvBpni6TjMeFBFr MPhXNWRZ4DLCxeBAGYzAd1VebFHD0wi9HVdzO1t6+bgAsf3xWMZNTQEEbR3YhCHZIKY9 vcMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=TK7M21I3CQtH9+E5TnMh16dY8yVcJMjclzvXdjTF7w4=; b=qixXeNdIUnnTjLpXJFflHiDdDsmWZ6kdYjkLydwH+9KWPETTO0+Pu3MAc/+d35+Gze 7uKrnd/x5lwRJDTiUfNpalpP+16IvbZJF+AtVgpz9LSv5fvjnRO5vqxcbDAz/nPD5/ka HOK6jAb/qFGBtc0bw0CnzFigIlS1/vZQIkgbPNJzj+reLhNhT2oF3prtqGCeK6orfNf6 TfON/Y4Zd2UxynQaHqNln+RpkuqO0ynVD7ljPca6IGvhCBGdzNdCeEc4SyrWQUMsTqt9 ITmWAAhyy+n9I/lvKGEBGC7F6EdeOalcCdGus2k84/TSQ6sVTL89Xm+15yjxs/tOELrI ON1w== 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 a74si2598229pfj.287.2018.03.14.12.29.59; Wed, 14 Mar 2018 12:30:16 -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 S1752043AbeCNT2c (ORCPT + 99 others); Wed, 14 Mar 2018 15:28:32 -0400 Received: from terminus.zytor.com ([198.137.202.136]:51049 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751302AbeCNT23 (ORCPT ); Wed, 14 Mar 2018 15:28:29 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w2EJRr5L005727; Wed, 14 Mar 2018 12:27:53 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w2EJRrnj005724; Wed, 14 Mar 2018 12:27:53 -0700 Date: Wed, 14 Mar 2018 12:27:53 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Toshi Kani Message-ID: Cc: tglx@linutronix.de, luto@kernel.org, linux-kernel@vger.kernel.org, mingo@kernel.org, toshi.kani@hpe.com, bp@alien8.de, hpa@zytor.com, gratian.crisan@ni.com Reply-To: toshi.kani@hpe.com, mingo@kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, luto@kernel.org, gratian.crisan@ni.com, hpa@zytor.com, bp@alien8.de In-Reply-To: <20180313170347.3829-2-toshi.kani@hpe.com> References: <20180313170347.3829-2-toshi.kani@hpe.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/mm: Fix vmalloc_fault to use pXd_large Git-Commit-ID: 18a955219bf7d9008ce480d4451b6b8bf4483a22 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 18a955219bf7d9008ce480d4451b6b8bf4483a22 Gitweb: https://git.kernel.org/tip/18a955219bf7d9008ce480d4451b6b8bf4483a22 Author: Toshi Kani AuthorDate: Tue, 13 Mar 2018 11:03:46 -0600 Committer: Thomas Gleixner CommitDate: Wed, 14 Mar 2018 20:22:42 +0100 x86/mm: Fix vmalloc_fault to use pXd_large 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 --- arch/x86/mm/fault.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index c88573d90f3e..25a30b5d6582 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c @@ -330,7 +330,7 @@ static noinline int vmalloc_fault(unsigned long address) 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(unsigned long address) 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(unsigned long address) 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);