From patchwork Thu Mar 5 15:11:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Sankar X-Patchwork-Id: 11422063 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9E4CD138D for ; Thu, 5 Mar 2020 15:11:59 +0000 (UTC) Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.kernel.org (Postfix) with SMTP id 106752070E for ; Thu, 5 Mar 2020 15:11:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 106752070E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=alum.mit.edu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernel-hardening-return-18076-patchwork-kernel-hardening=patchwork.kernel.org@lists.openwall.com Received: (qmail 11951 invoked by uid 550); 5 Mar 2020 15:11:57 -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 11919 invoked from network); 5 Mar 2020 15:11:57 -0000 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=PjbkYOJJF4QVM5t+Vwl8Y4BXszbEfFKAKxz7B3KWc7g=; b=a0sKhZ3jmeXbALF1em2q3zdTZik4Ch1j/4jXTwJLn0sXCqRnR1DmZrm+C5HRL5I93O 59REQUx78yCimQSr+cywMgwWUlC/KoXKDNDMkuRhpR02+5UE+HayIEFPseq0iSUJoM93 ofe8bHr7lU6qZOMUT/RxMYY5DUTuXp6voO0qux9b7Mphk5KOpnmiNcoG6YoirO4M/K9q XjIpopiP4KdbdULx+LOb/cxdKqd2jNY/dAEgfiWAUJbdsy2AmPZP8kdKulASlZEgNT+F Hbz8aBjRhX76tsgNGhedUnYCg6ffQIhddsmqLQh9NsLmaf4KZLGjZuJWS7UkPvqPRgKL Oy/A== X-Gm-Message-State: ANhLgQ0ls6O0edFnSEFKHOk0klxdJ/vs+KM2ZsK7fdknvhbJZ5nfNnV/ fqEGpPOxtdzECmDfc/b+Hq8= X-Google-Smtp-Source: ADFU+vtlWGM1UZ1f2aliBPEDyGuIg9uQXGA6okBMuDSwkcXoOJqL+PG1QBjgeAKnASBWIjuWGN8Egw== X-Received: by 2002:a37:b984:: with SMTP id j126mr8051038qkf.3.1583421105629; Thu, 05 Mar 2020 07:11:45 -0800 (PST) From: Arvind Sankar To: Kees Cook Cc: "Tobin C . Harding" , Tycho Andersen , kernel-hardening@lists.openwall.com, Chris Zankel , Max Filippov , linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org Subject: [PATCH] xtensa/mm: Stop printing the virtual memory layout Date: Thu, 5 Mar 2020 10:11:44 -0500 Message-Id: <20200305151144.836824-1-nivedita@alum.mit.edu> X-Mailer: git-send-email 2.24.1 In-Reply-To: <202003021038.8F0369D907@keescook> References: <202003021038.8F0369D907@keescook> MIME-Version: 1.0 For security, don't display the kernel's virtual memory layout. Kees Cook points out: "These have been entirely removed on other architectures, so let's just do the same for ia32 and remove it unconditionally." 071929dbdd86 ("arm64: Stop printing the virtual memory layout") 1c31d4e96b8c ("ARM: 8820/1: mm: Stop printing the virtual memory layout") 31833332f798 ("m68k/mm: Stop printing the virtual memory layout") fd8d0ca25631 ("parisc: Hide virtual kernel memory layout") adb1fe9ae2ee ("mm/page_alloc: Remove kernel address exposure in free_reserved_area()") Signed-off-by: Arvind Sankar Acked-by: Tycho Andersen --- arch/xtensa/mm/init.c | 46 ------------------------------------------- 1 file changed, 46 deletions(-) diff --git a/arch/xtensa/mm/init.c b/arch/xtensa/mm/init.c index 19c625e6d81f..7ba3f1fce8ec 100644 --- a/arch/xtensa/mm/init.c +++ b/arch/xtensa/mm/init.c @@ -155,52 +155,6 @@ void __init mem_init(void) memblock_free_all(); mem_init_print_info(NULL); - pr_info("virtual kernel memory layout:\n" -#ifdef CONFIG_KASAN - " kasan : 0x%08lx - 0x%08lx (%5lu MB)\n" -#endif -#ifdef CONFIG_MMU - " vmalloc : 0x%08lx - 0x%08lx (%5lu MB)\n" -#endif -#ifdef CONFIG_HIGHMEM - " pkmap : 0x%08lx - 0x%08lx (%5lu kB)\n" - " fixmap : 0x%08lx - 0x%08lx (%5lu kB)\n" -#endif - " lowmem : 0x%08lx - 0x%08lx (%5lu MB)\n" - " .text : 0x%08lx - 0x%08lx (%5lu kB)\n" - " .rodata : 0x%08lx - 0x%08lx (%5lu kB)\n" - " .data : 0x%08lx - 0x%08lx (%5lu kB)\n" - " .init : 0x%08lx - 0x%08lx (%5lu kB)\n" - " .bss : 0x%08lx - 0x%08lx (%5lu kB)\n", -#ifdef CONFIG_KASAN - KASAN_SHADOW_START, KASAN_SHADOW_START + KASAN_SHADOW_SIZE, - KASAN_SHADOW_SIZE >> 20, -#endif -#ifdef CONFIG_MMU - VMALLOC_START, VMALLOC_END, - (VMALLOC_END - VMALLOC_START) >> 20, -#ifdef CONFIG_HIGHMEM - PKMAP_BASE, PKMAP_BASE + LAST_PKMAP * PAGE_SIZE, - (LAST_PKMAP*PAGE_SIZE) >> 10, - FIXADDR_START, FIXADDR_TOP, - (FIXADDR_TOP - FIXADDR_START) >> 10, -#endif - PAGE_OFFSET, PAGE_OFFSET + - (max_low_pfn - min_low_pfn) * PAGE_SIZE, -#else - min_low_pfn * PAGE_SIZE, max_low_pfn * PAGE_SIZE, -#endif - ((max_low_pfn - min_low_pfn) * PAGE_SIZE) >> 20, - (unsigned long)_text, (unsigned long)_etext, - (unsigned long)(_etext - _text) >> 10, - (unsigned long)__start_rodata, (unsigned long)__end_rodata, - (unsigned long)(__end_rodata - __start_rodata) >> 10, - (unsigned long)_sdata, (unsigned long)_edata, - (unsigned long)(_edata - _sdata) >> 10, - (unsigned long)__init_begin, (unsigned long)__init_end, - (unsigned long)(__init_end - __init_begin) >> 10, - (unsigned long)__bss_start, (unsigned long)__bss_stop, - (unsigned long)(__bss_stop - __bss_start) >> 10); } static void __init parse_memmap_one(char *p)