From patchwork Mon Mar 20 19:40:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Garnier X-Patchwork-Id: 9635229 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E3ABB602D6 for ; Mon, 20 Mar 2017 19:40:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D29172684F for ; Mon, 20 Mar 2017 19:40:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C6CE426E96; Mon, 20 Mar 2017 19:40:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id 006B22684F for ; Mon, 20 Mar 2017 19:40:47 +0000 (UTC) Received: (qmail 19772 invoked by uid 550); 20 Mar 2017 19:40:44 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 19745 invoked from network); 20 Mar 2017 19:40:43 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=2RjuoSDChdYAiU8V60dxu2BdJpgdIzjMq9wxPBDctnA=; b=r8z40YdwleSh7o33zxycrziZkl3Q0j3g08Vtz3Q4FUmOVFAYs1LmccOMw1sKA1XfU2 DPhra5J2PnDH1dsMSY62deOD2TPctSnRqNA6WLCxP08aeMaGd1Z5KFcZ1FwGLFReo4AQ +g1ZEvr2AeOEGcZWrrtDnqQbmxtoRI83eI+fOZY+52fJGhBh6D8tibibsZmfoNhj8yJ4 cuS+KiFSalnHOUSwt/CeAY+fBbnRgnKh1PVh/NaxKkbBoZ8ujHtTE2Q4rJE+GmPdVbQC E+pchcmJGUqRYEHT5Zbl5OqV5IQCM9Hfcw8mPq6z++0zx8Sp3LX/N/2MvVA3HvsHNgVn 0gyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=2RjuoSDChdYAiU8V60dxu2BdJpgdIzjMq9wxPBDctnA=; b=MWvQ53D/+jeZhvW2RvX/vqzV9TvpbLQ23U73NfofY0+vXT0UF9gUQ4zBS8pALmbect a/rLVlM0amt+HYAaKoQ9zLB2eijqGRIGg2SDQLPMJxrBHL9it6UB9ZFKZQ4b6vtqG3iZ xII+ZMIHoT08Q+m8NVUmSdr2s7Yh+mXEnI0vDHDAPZtNmibjeItYoJxxPEt87snAdXE4 SeW2kqstD7u6i70vIi2B4ghmEB8Y/GCWxOy0J6K3/wxsUDQA8fbJ/r/x4plE5pN1bIXQ x+oQV5nnSHduXs5pMWCUjg/MCs5OWtOf+2agOZqGeMkb49IyNwXEXSIctx5ZignPG1rS foJA== X-Gm-Message-State: AFeK/H2MMIzxobkR0YPMXllToO5BfKzt0aLTnrwuKpfDT5vcag1CFqxTjAQ6UR9vm3XkZO2/ X-Received: by 10.98.208.65 with SMTP id p62mr34564961pfg.239.1490038831261; Mon, 20 Mar 2017 12:40:31 -0700 (PDT) From: Thomas Garnier To: Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Thomas Garnier , Kees Cook , Andrew Morton , Dave Hansen , Borislav Petkov , Hugh Dickins , Xiao Guangrong , Matthew Wilcox , Boris Ostrovsky , Andy Lutomirski , Paul Gortmaker , Michal Hocko , zijun_hu , Chris Wilson Cc: x86@kernel.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, linux-mm@kvack.org, kernel-hardening@lists.openwall.com, richard.weiyang@gmail.com Date: Mon, 20 Mar 2017 12:40:24 -0700 Message-Id: <20170320194024.60749-1-thgarnie@google.com> X-Mailer: git-send-email 2.12.0.367.g23dc2f6d3c-goog Subject: [kernel-hardening] [PATCH tip v2] x86/mm: Correct fixmap header usage on adaptable MODULES_END X-Virus-Scanned: ClamAV using ClamSMTP This patch removes fixmap headers on non-x86 code introduced by the adaptable MODULE_END change. It is also removed in the 32-bit pgtable header. Instead, it is added by default in the pgtable generic header for both architectures. Signed-off-by: Thomas Garnier --- arch/x86/include/asm/pgtable.h | 1 + arch/x86/include/asm/pgtable_32.h | 1 - arch/x86/kernel/module.c | 1 - arch/x86/mm/dump_pagetables.c | 1 - arch/x86/mm/kasan_init_64.c | 1 - mm/vmalloc.c | 4 ---- 6 files changed, 1 insertion(+), 8 deletions(-) diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index 6f6f351e0a81..78d1fc32e947 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h @@ -598,6 +598,7 @@ pte_t *populate_extra_pte(unsigned long vaddr); #include #include #include +#include static inline int pte_none(pte_t pte) { diff --git a/arch/x86/include/asm/pgtable_32.h b/arch/x86/include/asm/pgtable_32.h index fbc73360aea0..bfab55675c16 100644 --- a/arch/x86/include/asm/pgtable_32.h +++ b/arch/x86/include/asm/pgtable_32.h @@ -14,7 +14,6 @@ */ #ifndef __ASSEMBLY__ #include -#include #include #include diff --git a/arch/x86/kernel/module.c b/arch/x86/kernel/module.c index fad61caac75e..477ae806c2fa 100644 --- a/arch/x86/kernel/module.c +++ b/arch/x86/kernel/module.c @@ -35,7 +35,6 @@ #include #include #include -#include #if 0 #define DEBUGP(fmt, ...) \ diff --git a/arch/x86/mm/dump_pagetables.c b/arch/x86/mm/dump_pagetables.c index 75efeecc85eb..58b5bee7ea27 100644 --- a/arch/x86/mm/dump_pagetables.c +++ b/arch/x86/mm/dump_pagetables.c @@ -20,7 +20,6 @@ #include #include -#include /* * The dumper groups pagetable entries of the same type into one, and for diff --git a/arch/x86/mm/kasan_init_64.c b/arch/x86/mm/kasan_init_64.c index 1bde19ef86bd..8d63d7a104c3 100644 --- a/arch/x86/mm/kasan_init_64.c +++ b/arch/x86/mm/kasan_init_64.c @@ -9,7 +9,6 @@ #include #include -#include extern pgd_t early_level4_pgt[PTRS_PER_PGD]; extern struct range pfn_mapped[E820_X_MAX]; diff --git a/mm/vmalloc.c b/mm/vmalloc.c index b7d2a23349f4..0dd80222b20b 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -36,10 +36,6 @@ #include #include -#ifdef CONFIG_X86 -# include -#endif - #include "internal.h" struct vfree_deferred {