mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Baoquan He <bhe@redhat.com>
To: Yinghai Lu <yinghai@kernel.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@redhat.com>,
	Kees Cook <keescook@chromium.org>, Borislav Petkov <bp@suse.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Jiri Kosina <jkosina@suse.cz>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Matt Fleming <matt.fleming@intel.com>
Subject: Re: [PATCH v4] x86, kaslr: Access the correct kaslr_enabled variable
Date: Mon, 16 Mar 2015 13:19:35 +0800	[thread overview]
Message-ID: <20150316051935.GF26587@dhcp-16-105.nay.redhat.com> (raw)
In-Reply-To: <CAE9FiQVCo4a2oJHzahfmM0GpwKQnY2F9vSwCKDwzc7CWB4swdg@mail.gmail.com>

On 03/15/15 at 10:04pm, Yinghai Lu wrote:
> On Sun, Mar 15, 2015 at 8:28 PM, Baoquan He <bhe@redhat.com> wrote:
> > On 03/15/15 at 12:49am, Yinghai Lu wrote:
> >
> > It's good to check the ret value as Boris suggested. However it could
> > fail since early_memremap self fail, e.g slot not found. In this case
> > making kaslr_enabled true may not be good.
> 
> It should not fail. we always follow map/access/unmap. and sometime
> would have two for copying between them.

Well, then I would say if add checking too in other places for
setup_data handling, e.g parse_setup_data you mentioned. Or don't check
at all place to make them consistent. 

> 
> >
> > As Minfei talked with you kaslr_setup_data is a global variable inside
> > kernel code, it has been ident mapped. Just derefencing the physical
> > address which is virtual address too and getting the real stored value
> > may be safer.
> 
> No.
> That ident mapping is set in arch/x86/kernel/head_64.S and it
> is only for switchover. and it is gone when
> arch/x86/kernel/head64.c::x86_64_start_kernel/reset_early_page_tables
> is called.
> 
> That reset_early_page_tables will only keep kernel high mapping
> and clear all other.

Ah, yes. You are right. I didn't get this clearly, Thanks for telling.

Thanks
Baoquan

> 
> Thanks
> 
> Yinghai

      reply	other threads:[~2015-03-16  5:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-15  7:49 Yinghai Lu
2015-03-15 12:18 ` Minfei Huang
2015-03-15 17:02   ` Yinghai Lu
2015-03-16  3:08     ` Minfei Huang
2015-03-16  3:28 ` Baoquan He
2015-03-16  4:36   ` Yinghai Lu
2015-03-16  5:11     ` Baoquan He
2015-03-16  5:04   ` Yinghai Lu
2015-03-16  5:19     ` Baoquan He [this message]

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=20150316051935.GF26587@dhcp-16-105.nay.redhat.com \
    --to=bhe@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=bp@suse.de \
    --cc=hpa@zytor.com \
    --cc=jkosina@suse.cz \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt.fleming@intel.com \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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®