public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@redhat.com>
To: Dave Young <dyoung@redhat.com>
Cc: keescook@chromium.org, hpa@zytor.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] disable kaslr in kdump kernel
Date: Tue, 11 Feb 2014 08:16:40 -0500	[thread overview]
Message-ID: <20140211131640.GB1055@redhat.com> (raw)
In-Reply-To: <20140211100837.GA17202@dhcp-16-126.nay.redhat.com>

On Tue, Feb 11, 2014 at 06:08:38PM +0800, Dave Young wrote:
> 
> KASLR does not work in kdump kernel because it's too early that mem=exactmap
> has not been parsed.
> 
> Since KASLR does not make much sense for kdump kernel thus let's disable it
> for kdump kernel. To check if it is a kdump kernel I just check the cmdline
> param elfcorehdr just like is_kdump_kernel.
> 
> Signed-off-by: Dave Young <dyoung@redhat.com>

I don't think it is a good idea. I don't like hardcoding second kernel's
behavior. I rather vary second kernel's behavior based on command line
parameters or based on values passed in bootparams.

So I am more than happy to pass command line option "nokaslr" instead
of hardcoding this in kernel.

Thanks
Vivek

> ---
>  linux-2.6/arch/x86/boot/compressed/aslr.c |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> Index: dyoung/git/linux-2.6/arch/x86/boot/compressed/aslr.c
> ===================================================================
> --- linux-2.6/arch/x86/boot/compressed/aslr.c
> +++ linux-2.6/arch/x86/boot/compressed/aslr.c
> @@ -293,6 +293,11 @@ unsigned char *choose_kernel_location(un
>  		goto out;
>  	}
>  
> +	if (cmdline_find_option("elfcorehdr", NULL, 0) != -1) {
> +		debug_putstr("KASLR disabled...\n");
> +		goto out;
> +	}
> +
>  	/* Record the various known unsafe memory ranges. */
>  	mem_avoid_init((unsigned long)input, input_size,
>  		       (unsigned long)output, output_size);

  reply	other threads:[~2014-02-11 13:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-11 10:08 [PATCH] disable kaslr in kdump kernel Dave Young
2014-02-11 13:16 ` Vivek Goyal [this message]
2014-02-12  1:37   ` Dave Young
2014-02-12 14:05     ` Vivek Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140211131640.GB1055@redhat.com \
    --to=vgoyal@redhat.com \
    --cc=dyoung@redhat.com \
    --cc=hpa@zytor.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox