Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3010612imu; Fri, 23 Nov 2018 19:17:56 -0800 (PST) X-Google-Smtp-Source: AFSGD/Xa2c74scEGuFKegJxD9PI0Gkplbf2NfndqLG+YtCH6Jut9hoT0cnGyhousHGZFigPGRlJg X-Received: by 2002:a63:e001:: with SMTP id e1mr16648872pgh.39.1543029476640; Fri, 23 Nov 2018 19:17:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543029476; cv=none; d=google.com; s=arc-20160816; b=SH7kzD1T5QoCJA2TM9GJEbZk5CtBS45kAgp0+uL2CmEBB08k4k9HqVTHEyy4mNanur 22GOT2ZeQUT6ucP2YEvzS/7/MgjkZteHCd5FSFaOTQXAs7PCSR67EH7J0SXI4jkuv/4y OIBbEDOy3fbtISRl7hYz1vC3JOF99QsvfNFnMNiupPcRxsFVnKQOVJa3Gz5imjwkGTKn PAX1yG0RGPOxYldiGC+qFF8HndU59i7+K38rebR1IE1i55Dn7PVkQMtfqF9t2LNSsokm oXDPg81reOs0+4PqZQeXa/LnUpCH2az6jk/v86KKhIYDU+grhkNLbcGMhOUZeWIEr0K/ WZwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=9HidV9vq6uOAZbu35DoYVQSDNjcPhgv67SSbRGZ00Ns=; b=u3piRRdhzYsK8Rrx8ZYwg9y82Y3p1+JJRxTFSRBZc/5I1tsCDGIEpT+BYnpjM1jvM0 iwsryhMpn1ox7/y0w/ooXo+lpu28BiqnB2fv7f3MPPdHCsaWP47e1q7wdIzqaPowGbs/ TIsCG5wi/2qdRIFAKOcoO4vDY3Yc6VrtR7RFAuRe42PDs2r849vKuhJ8LoD5UwVbE1NH A2eerJBr+XYy0ru5gJrmnHLyRkHuqXDeUJYIleufTx369ztT6/o9/gJ2c1qI9THibxJs QMMZPeIg5uemg0mM7L4cE3kMJBYmqR+rVdSamyiCtL49wP+9t0cG4v3BrmONN0BTlDuj xPqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.de header.s=amazon201209 header.b=ifTLsn5t; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c76si42400509pga.70.2018.11.23.19.17.42; Fri, 23 Nov 2018 19:17:56 -0800 (PST) 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; dkim=pass header.i=@amazon.de header.s=amazon201209 header.b=ifTLsn5t; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406006AbeKWDak (ORCPT + 99 others); Thu, 22 Nov 2018 22:30:40 -0500 Received: from smtp-fw-9101.amazon.com ([207.171.184.25]:39541 "EHLO smtp-fw-9101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403983AbeKWDaQ (ORCPT ); Thu, 22 Nov 2018 22:30:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.de; i=@amazon.de; q=dns/txt; s=amazon201209; t=1542905406; x=1574441406; h=from:to:cc:subject:date:message-id; bh=9HidV9vq6uOAZbu35DoYVQSDNjcPhgv67SSbRGZ00Ns=; b=ifTLsn5t56gaQSleYI6wXr8h/FY56HMBnNVk6NIpmarebakomnUfVvfu ukv1K03CjWYOZSxpper44g0qShh+SRQhnm8q09bJpHwIAYLPzrKAj3S0w ++icyckuCxrswg4RIAqpe2X8NlBHSKscdjjNXiz/8MFFv43ftVZcWmKD5 E=; X-IronPort-AV: E=Sophos;i="5.56,253,1539648000"; d="scan'208";a="771919550" Received: from sea3-co-svc-lb6-vlan3.sea.amazon.com (HELO email-inbound-relay-2a-69849ee2.us-west-2.amazon.com) ([10.47.22.38]) by smtp-border-fw-out-9101.sea19.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 22 Nov 2018 16:50:03 +0000 Received: from u54ee758033e858cfa736.ant.amazon.com (pdx2-ws-svc-lb17-vlan3.amazon.com [10.247.140.70]) by email-inbound-relay-2a-69849ee2.us-west-2.amazon.com (8.14.7/8.14.7) with ESMTP id wAMGnxNH100567 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 22 Nov 2018 16:50:01 GMT Received: from u54ee758033e858cfa736.ant.amazon.com (localhost [127.0.0.1]) by u54ee758033e858cfa736.ant.amazon.com (8.15.2/8.15.2/Debian-3) with ESMTP id wAMGnwbI008114; Thu, 22 Nov 2018 17:49:58 +0100 Received: (from jsteckli@localhost) by u54ee758033e858cfa736.ant.amazon.com (8.15.2/8.15.2/Submit) id wAMGnwRd008113; Thu, 22 Nov 2018 17:49:58 +0100 From: Julian Stecklina To: kernel-hardening@lists.openwall.com Cc: Julian Stecklina , Liran Alon , Tycho Andersen , Jonathan Adams , David Woodhouse , LKML Subject: [RFC RESEND PATCH 3/6] mm, x86: make __kernel_map_pages always available Date: Thu, 22 Nov 2018 17:49:36 +0100 Message-Id: <0ba5f3c6d7fc0078d091c507cda980ef5cd710b2.1542905228.git.jsteckli@amazon.de> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org __kernel_map_pages is currently only enabled when CONFIG_DEBUG_PAGEALLOC is defined. Enable it unconditionally instead. Signed-off-by: Julian Stecklina --- arch/x86/mm/pageattr.c | 3 +-- include/linux/mm.h | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index 51a5a69ecac9..bd3b194400c1 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c @@ -2025,8 +2025,6 @@ int set_pages_rw(struct page *page, int numpages) return set_memory_rw(addr, numpages); } -#ifdef CONFIG_DEBUG_PAGEALLOC - static int __set_pages_p(struct page *page, int numpages) { unsigned long tempaddr = (unsigned long) page_address(page); @@ -2093,6 +2091,7 @@ void __kernel_map_pages(struct page *page, int numpages, int enable) arch_flush_lazy_mmu_mode(); } +#ifdef CONFIG_DEBUG_PAGEALLOC #ifdef CONFIG_HIBERNATION bool kernel_page_present(struct page *page) diff --git a/include/linux/mm.h b/include/linux/mm.h index a61ebe8ad4ca..a0b9feefebb1 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2589,9 +2589,10 @@ static inline void kernel_poison_pages(struct page *page, int numpages, int enable) { } #endif +extern void __kernel_map_pages(struct page *page, int numpages, int enable); + #ifdef CONFIG_DEBUG_PAGEALLOC extern bool _debug_pagealloc_enabled; -extern void __kernel_map_pages(struct page *page, int numpages, int enable); static inline bool debug_pagealloc_enabled(void) { -- 2.17.1