public inbox for linux-efi@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Baoquan He <bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>,
	Ingo Molnar <mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	"H. Peter Anvin" <hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>,
	"x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org"
	<x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	"linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Thomas Garnier <thgarnie-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
	Kees Cook <keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
	Borislav Petkov <bp-Gina5bIWoIWzQB+pC5nmwQ@public.gmane.org>,
	Andrew Morton
	<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
	Masahiro Yamada
	<yamada.masahiro-uWyLwvC0a2jby3iVrkZq2A@public.gmane.org>,
	Bhupesh Sharma <bhsharma-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH v2] x86/mm/KASLR: EFI region is mistakenly included into KASLR VA space for randomization
Date: Fri, 24 Mar 2017 11:36:24 +0100	[thread overview]
Message-ID: <20170324103624.GA6231@gmail.com> (raw)
In-Reply-To: <CAKv+Gu_V_VAWuDtKyOY9RS+cdhi+c5z2a7n2kcXVybvvdmPYBw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>


* Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:

> No. It is the firmware's EFI code, and the virtual translation applied by the OS 
> is made known to the firmware by means of a call into the runtime service 
> SetVirtualAddressMap(). This service can only be called once after each boot, 
> and so kexec kernels are forced to use the same VA mapping for runtime services 
> as the first kernel. This is the whole point of having a VA region reserved for 
> this, so that kexec kernels are guaranteed to be able to use the same VA 
> mapping.

Yes, but it's the kernel's EFI code that determines the area! So my suggestion:

> > Preserving virtual addresses for kexec is a red herring: the randomized offset 
> > could be passed to the kexec-ed kernel just fine.

Would solve the kexec problem, right?

I.e. the first kernel that boots randomizes the address range - and passes that 
offset off to any subsequent kernels.

Turning KASLR off actively degrades that randomization of the kernel virtual 
addresses.

Am I missing anything?

Thanks,

	Ingo

  parent reply	other threads:[~2017-03-24 10:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-24  4:59 [PATCH v2] x86/mm/KASLR: EFI region is mistakenly included into KASLR VA space for randomization Baoquan He
     [not found] ` <1490331592-31860-1-git-send-email-bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-03-24  8:08   ` Ingo Molnar
     [not found]     ` <20170324080833.GA15200-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-03-24  8:34       ` Baoquan He
2017-03-24  8:46         ` Dave Young
2017-03-24  9:24           ` Ingo Molnar
2017-03-24  9:36             ` Borislav Petkov
     [not found]             ` <20170324092433.GA3237-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-03-24  9:37               ` Ard Biesheuvel
2017-03-24  9:40                 ` Borislav Petkov
2017-03-24  9:42                   ` Ard Biesheuvel
     [not found]                     ` <CAKv+Gu9cyMccPSjzr9XGT6Gkhq57is+i_VajsZMTbd9eOAMkwQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-24  9:46                       ` Borislav Petkov
     [not found]                         ` <20170324094656.r2nln4vbidj5jhqt-fF5Pk5pvG8Y@public.gmane.org>
2017-03-24  9:52                           ` Ard Biesheuvel
     [not found]                 ` <CAKv+Gu_V_VAWuDtKyOY9RS+cdhi+c5z2a7n2kcXVybvvdmPYBw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-24 10:36                   ` Ingo Molnar [this message]
2017-03-24 10:42                     ` Ard Biesheuvel
2017-03-24 10:54                       ` Ingo Molnar
2017-03-24 11:52             ` Baoquan He
2017-03-24  8:53     ` Dave Young

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=20170324103624.GA6231@gmail.com \
    --to=mingo-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
    --cc=ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=bhsharma-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=bp-Gina5bIWoIWzQB+pC5nmwQ@public.gmane.org \
    --cc=dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org \
    --cc=keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
    --cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org \
    --cc=thgarnie-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=yamada.masahiro-uWyLwvC0a2jby3iVrkZq2A@public.gmane.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