Skip to content

Commit 681ff01

Browse files
nivedita76KAGA-KOKO
authored andcommitted
x86/mm/init/32: Stop printing the virtual memory layout
For security reasons, 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." 071929d ("arm64: Stop printing the virtual memory layout") 1c31d4e ("ARM: 8820/1: mm: Stop printing the virtual memory layout") 3183333 ("m68k/mm: Stop printing the virtual memory layout") fd8d0ca ("parisc: Hide virtual kernel memory layout") adb1fe9 ("mm/page_alloc: Remove kernel address exposure in free_reserved_area()") Signed-off-by: Arvind Sankar <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Tycho Andersen <[email protected]> Acked-by: Kees Cook <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 98d54f8 commit 681ff01

File tree

1 file changed

+0
-38
lines changed

1 file changed

+0
-38
lines changed

arch/x86/mm/init_32.c

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -788,44 +788,6 @@ void __init mem_init(void)
788788
x86_init.hyper.init_after_bootmem();
789789

790790
mem_init_print_info(NULL);
791-
printk(KERN_INFO "virtual kernel memory layout:\n"
792-
" fixmap : 0x%08lx - 0x%08lx (%4ld kB)\n"
793-
" cpu_entry : 0x%08lx - 0x%08lx (%4ld kB)\n"
794-
#ifdef CONFIG_HIGHMEM
795-
" pkmap : 0x%08lx - 0x%08lx (%4ld kB)\n"
796-
#endif
797-
" vmalloc : 0x%08lx - 0x%08lx (%4ld MB)\n"
798-
" lowmem : 0x%08lx - 0x%08lx (%4ld MB)\n"
799-
" .init : 0x%08lx - 0x%08lx (%4ld kB)\n"
800-
" .data : 0x%08lx - 0x%08lx (%4ld kB)\n"
801-
" .text : 0x%08lx - 0x%08lx (%4ld kB)\n",
802-
FIXADDR_START, FIXADDR_TOP,
803-
(FIXADDR_TOP - FIXADDR_START) >> 10,
804-
805-
CPU_ENTRY_AREA_BASE,
806-
CPU_ENTRY_AREA_BASE + CPU_ENTRY_AREA_MAP_SIZE,
807-
CPU_ENTRY_AREA_MAP_SIZE >> 10,
808-
809-
#ifdef CONFIG_HIGHMEM
810-
PKMAP_BASE, PKMAP_BASE+LAST_PKMAP*PAGE_SIZE,
811-
(LAST_PKMAP*PAGE_SIZE) >> 10,
812-
#endif
813-
814-
VMALLOC_START, VMALLOC_END,
815-
(VMALLOC_END - VMALLOC_START) >> 20,
816-
817-
(unsigned long)__va(0), (unsigned long)high_memory,
818-
((unsigned long)high_memory - (unsigned long)__va(0)) >> 20,
819-
820-
(unsigned long)&__init_begin, (unsigned long)&__init_end,
821-
((unsigned long)&__init_end -
822-
(unsigned long)&__init_begin) >> 10,
823-
824-
(unsigned long)&_etext, (unsigned long)&_edata,
825-
((unsigned long)&_edata - (unsigned long)&_etext) >> 10,
826-
827-
(unsigned long)&_text, (unsigned long)&_etext,
828-
((unsigned long)&_etext - (unsigned long)&_text) >> 10);
829791

830792
/*
831793
* Check boundaries twice: Some fundamental inconsistencies can

0 commit comments

Comments
 (0)