linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/32: Stop printing Kernel virtual memory layout
@ 2025-01-08 18:40 Christophe Leroy
  2025-01-08 21:48 ` Kees Cook
  2025-02-26  4:46 ` Madhavan Srinivasan
  0 siblings, 2 replies; 3+ messages in thread
From: Christophe Leroy @ 2025-01-08 18:40 UTC (permalink / raw)
  To: Michael Ellerman, Nicholas Piggin, Naveen N Rao,
	Madhavan Srinivasan
  Cc: Christophe Leroy, linux-kernel, linuxppc-dev, Arvind Sankar,
	Kees Cook

Printing of Kernel virtual memory layout was added for debug purpose
by commit f637a49e507c ("powerpc: Minor cleanups of kernel virt
address space definitions")

For security reasons, don't display the kernel's virtual memory layout.

Other architectures have removed it through following commits.

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")
681ff0181bbf ("x86/mm/init/32: Stop printing the virtual memory layout")

Commit 681ff0181bbf ("x86/mm/init/32: Stop printing the virtual memory
layout") thought x86 was the last one, but in reality powerpc/32 still
had it.

So remove it now on powerpc/32 as well.

Cc: Arvind Sankar <nivedita@alum.mit.edu>
Cc: Kees Cook <keescook@chromium.org>
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
 arch/powerpc/mm/mem.c | 22 ----------------------
 1 file changed, 22 deletions(-)

diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index c7708c8fad29..34806c858e54 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -319,28 +319,6 @@ void __init mem_init(void)
 	per_cpu(next_tlbcam_idx, smp_processor_id()) =
 		(mfspr(SPRN_TLB1CFG) & TLBnCFG_N_ENTRY) - 1;
 #endif
-
-#ifdef CONFIG_PPC32
-	pr_info("Kernel virtual memory layout:\n");
-#ifdef CONFIG_KASAN
-	pr_info("  * 0x%08lx..0x%08lx  : kasan shadow mem\n",
-		KASAN_SHADOW_START, KASAN_SHADOW_END);
-#endif
-	pr_info("  * 0x%08lx..0x%08lx  : fixmap\n", FIXADDR_START, FIXADDR_TOP);
-#ifdef CONFIG_HIGHMEM
-	pr_info("  * 0x%08lx..0x%08lx  : highmem PTEs\n",
-		PKMAP_BASE, PKMAP_ADDR(LAST_PKMAP));
-#endif /* CONFIG_HIGHMEM */
-	if (ioremap_bot != IOREMAP_TOP)
-		pr_info("  * 0x%08lx..0x%08lx  : early ioremap\n",
-			ioremap_bot, IOREMAP_TOP);
-	pr_info("  * 0x%08lx..0x%08lx  : vmalloc & ioremap\n",
-		VMALLOC_START, VMALLOC_END);
-#ifdef MODULES_VADDR
-	pr_info("  * 0x%08lx..0x%08lx  : modules\n",
-		MODULES_VADDR, MODULES_END);
-#endif
-#endif /* CONFIG_PPC32 */
 }
 
 void free_initmem(void)
-- 
2.47.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] powerpc/32: Stop printing Kernel virtual memory layout
  2025-01-08 18:40 [PATCH] powerpc/32: Stop printing Kernel virtual memory layout Christophe Leroy
@ 2025-01-08 21:48 ` Kees Cook
  2025-02-26  4:46 ` Madhavan Srinivasan
  1 sibling, 0 replies; 3+ messages in thread
From: Kees Cook @ 2025-01-08 21:48 UTC (permalink / raw)
  To: Christophe Leroy
  Cc: Michael Ellerman, Nicholas Piggin, Naveen N Rao,
	Madhavan Srinivasan, linux-kernel, linuxppc-dev, Arvind Sankar

On Wed, Jan 08, 2025 at 07:40:38PM +0100, Christophe Leroy wrote:
> Printing of Kernel virtual memory layout was added for debug purpose
> by commit f637a49e507c ("powerpc: Minor cleanups of kernel virt
> address space definitions")
> 
> For security reasons, don't display the kernel's virtual memory layout.
> 
> Other architectures have removed it through following commits.
> 
> 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")
> 681ff0181bbf ("x86/mm/init/32: Stop printing the virtual memory layout")
> 
> Commit 681ff0181bbf ("x86/mm/init/32: Stop printing the virtual memory
> layout") thought x86 was the last one, but in reality powerpc/32 still
> had it.
> 
> So remove it now on powerpc/32 as well.
> 
> Cc: Arvind Sankar <nivedita@alum.mit.edu>
> Cc: Kees Cook <keescook@chromium.org>
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>

Reviewed-by: Kees Cook <kees@kernel.org>

-- 
Kees Cook


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] powerpc/32: Stop printing Kernel virtual memory layout
  2025-01-08 18:40 [PATCH] powerpc/32: Stop printing Kernel virtual memory layout Christophe Leroy
  2025-01-08 21:48 ` Kees Cook
@ 2025-02-26  4:46 ` Madhavan Srinivasan
  1 sibling, 0 replies; 3+ messages in thread
From: Madhavan Srinivasan @ 2025-02-26  4:46 UTC (permalink / raw)
  To: Michael Ellerman, Nicholas Piggin, Naveen N Rao, Christophe Leroy
  Cc: linux-kernel, linuxppc-dev, Arvind Sankar, Kees Cook

On Wed, 08 Jan 2025 19:40:38 +0100, Christophe Leroy wrote:
> Printing of Kernel virtual memory layout was added for debug purpose
> by commit f637a49e507c ("powerpc: Minor cleanups of kernel virt
> address space definitions")
> 
> For security reasons, don't display the kernel's virtual memory layout.
> 
> Other architectures have removed it through following commits.
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc/32: Stop printing Kernel virtual memory layout
      https://git.kernel.org/powerpc/c/2bf3caa7cc3b725eb671fb7e186daf685089eb86

Thanks


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-02-26  4:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-08 18:40 [PATCH] powerpc/32: Stop printing Kernel virtual memory layout Christophe Leroy
2025-01-08 21:48 ` Kees Cook
2025-02-26  4:46 ` Madhavan Srinivasan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).