mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Baoquan He <bhe@redhat.com>
Cc: linux-kernel@vger.kernel.org, Dave Young <dyoung@redhat.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	x86@kernel.org, Kees Cook <keescook@chromium.org>,
	Yinghai Lu <yinghai@kernel.org>, Borislav Petkov <bp@suse.de>,
	Dave Jiang <dave.jiang@intel.com>,
	Thomas Garnier <thgarnie@google.com>
Subject: Re: [PATCH v2] x86/KASLR: Use old ident map page table if physical randomization failed
Date: Fri, 28 Apr 2017 08:25:27 +0200	[thread overview]
Message-ID: <20170428062527.qx6wvh7ctdinzezs@gmail.com> (raw)
In-Reply-To: <1493278940-5885-1-git-send-email-bhe@redhat.com>


* Baoquan He <bhe@redhat.com> wrote:

> Dave found kdump kernel with kaslr enabled will reset to bios immediately
> if physical randomization failed to find a new position for kernel. But
> kernel with 'nokaslr' option works in this case.
> 
> The reason is kaslr will install a new page table for ident mapping,
> while it missed to consider building ident mapping for original area
> of kernel if kaslr failed on physical randomization.
> 
> This only happens in kexec/kdump kernel. Since ident mapping has been
> built for kexec/kdump in 1st kernel for the whole memory by calling
> init_pgtable(). Here if physical randomizaiton failed, it won't build
> ident mapping for the original area of kernel but change to new page
> table '_pgtable'. Then kernel will reset to bios immediately caused by
> no ident mapping.
> 
> While normal kernel won't be impacted because it comes here via
> startup_32() and cr3 will be _pgtable already. In startup_32() ident
> mapping is built for 0~4G area. In kaslr We just append to the existing
> area instead of entirely overwriting it for on-demand ident mapping
> building. So ident mapping for the original area of kernel is still
> there.
> 
> So for fixing it,  We just switch to the new ident mapping page table
> when physical kaslr succeeds. Otherwise we keep the old page table
> unchanged just like nokaslr does.
> 
> Signed-off-by: Baoquan He <bhe@redhat.com>
> Signed-off-by: Dave Young <dyoung@redhat.com>
> Acked-by: Kees Cook <keescook@chromium.org>

That's not a valid signoff chain. I made it:

 Reported-by: Dave Young <dyoung@redhat.com>
 Signed-off-by: Baoquan He <bhe@redhat.com>
 Acked-by: Dave Young <dyoung@redhat.com>
 Acked-by: Kees Cook <keescook@chromium.org>

(Let me know if that's not the proper authorship chain.)

Thanks,

	Ingo

  reply	other threads:[~2017-04-28  6:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-27  7:42 Baoquan He
2017-04-28  6:25 ` Ingo Molnar [this message]
2017-04-28  6:59   ` Baoquan He
2017-04-28  8:34 ` [tip:x86/boot] x86/KASLR: Fix kexec kernel boot crash when KASLR randomization fails tip-bot for Baoquan He

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=20170428062527.qx6wvh7ctdinzezs@gmail.com \
    --to=mingo@kernel.org \
    --cc=bhe@redhat.com \
    --cc=bp@suse.de \
    --cc=dave.jiang@intel.com \
    --cc=dyoung@redhat.com \
    --cc=hpa@zytor.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=thgarnie@google.com \
    --cc=x86@kernel.org \
    --cc=yinghai@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

all inboxes | Powered by JetHome®