diff mbox

[GIT,PULL] parisc architecture fixes for 4.15-rc7

Message ID 20180112215715.GA8246@ls3530.fritz.box (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Helge Deller Jan. 12, 2018, 9:57 p.m. UTC
Subject: [PATCH] parisc: Hide virtual kernel memory layout

For security reasons do not expose the virtual kernel memory layout to
userspace.

Signed-off-by: Helge Deller <deller@gmx.de>
Suggested-by: Kees Cook <keescook@chromium.org>
Cc: stable@vger.kernel.org # 4.15

--
To unsubscribe from this list: send the line "unsubscribe linux-parisc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Kees Cook Jan. 12, 2018, 10:26 p.m. UTC | #1
On Fri, Jan 12, 2018 at 1:57 PM, Helge Deller <deller@gmx.de> wrote:
>
>
> Subject: [PATCH] parisc: Hide virtual kernel memory layout
>
> For security reasons do not expose the virtual kernel memory layout to
> userspace.
>
> Signed-off-by: Helge Deller <deller@gmx.de>
> Suggested-by: Kees Cook <keescook@chromium.org>
> Cc: stable@vger.kernel.org # 4.15

Thanks!

Reviewed-by: Kees Cook <keescook@chromium.org>

-Kees

>
> diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
> index 48f41399fc0b..cab32ee824d2 100644
> --- a/arch/parisc/mm/init.c
> +++ b/arch/parisc/mm/init.c
> @@ -629,7 +629,12 @@ void __init mem_init(void)
>  #endif
>
>         mem_init_print_info(NULL);
> -#ifdef CONFIG_DEBUG_KERNEL /* double-sanity-check paranoia */
> +
> +#if 0
> +       /*
> +        * Do not expose the virtual kernel memory layout to userspace.
> +        * But keep code for debugging purposes.
> +        */
>         printk("virtual kernel memory layout:\n"
>                "    vmalloc : 0x%px - 0x%px   (%4ld MB)\n"
>                "    memory  : 0x%px - 0x%px   (%4ld MB)\n"
diff mbox

Patch

diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index 48f41399fc0b..cab32ee824d2 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -629,7 +629,12 @@  void __init mem_init(void)
 #endif
 
 	mem_init_print_info(NULL);
-#ifdef CONFIG_DEBUG_KERNEL /* double-sanity-check paranoia */
+
+#if 0
+	/*
+	 * Do not expose the virtual kernel memory layout to userspace.
+	 * But keep code for debugging purposes.
+	 */
 	printk("virtual kernel memory layout:\n"
 	       "    vmalloc : 0x%px - 0x%px   (%4ld MB)\n"
 	       "    memory  : 0x%px - 0x%px   (%4ld MB)\n"