Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1372851

Re: [PATCH] Prefer kASLR over Hibernation

From Kees Cook <keescook@chromium.org>
Newsgroups linux.kernel
Subject Re: [PATCH] Prefer kASLR over Hibernation
Date 2016-04-06 23:30 +0200
Message-ID <rl3bt-1Cm-35@gated-at.bofh.it> (permalink)
References <rl1CG-rk-11@gated-at.bofh.it> <rl25I-Tp-9@gated-at.bofh.it> <rl2Iq-1a7-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Apr 6, 2016 at 1:56 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> On Wed, Apr 6, 2016 at 1:17 PM, Pavel Machek <pavel@denx.de> wrote:
>>
>> Why is kASLR incompatible with hibernation? We can hibernate have
>> 4.3 kernel resume hibernation image of 4.2 kernel (on x86-64, and I
>> have patches for x86). Resuming kernel with different randomization
>> does not look that much different...
>
> Oh, I'd absolutely prefer to just allow kaslr together with
> hibernation if it actually works.
>
> Could the people who piped up to say that they actually use
> hibernation just try passing in the "kaslr" command line option on
> their machine, and see if it works for them? We could just remove the
> "no kaslr with hibername" code - or at least limit it to 32-bit for
> now..
>
> Because that would be lovely.

This is where our original investigation of having them coexist ended:
https://lkml.org/lkml/2014/6/15/180

To quote Rafael Wysocki:
> We're jumping from the boot kernel into the image kernel.  The virtual address
> comes from the image kernel, but the boot kernel has to use it.  The only way
> we can ensure that we'll jump to the right place is to pass the physical address
> in the header (otherwise we de facto assume that the virtual address of the
> target page frame will be the same in both the boot and the image kernels).
>
> The missing piece is that the code in swsusp_arch_resume() sets up temporary
> page tables to ensure that they won't be overwritten while copying the last
> remaining image kernel pages to the right page frames (those page tables
> have to be stored in page frames that are free from the kernel image perspective).
>
> But if the kernel address space is randomized, set_up_temporary_mappings()
> really should duplicate the existing layout instead of creating a new one from
> scratch.  Otherwise, virtual addresses before set_up_temporary_mappings() may
> be different from the ones after it.

-Kees

-- 
Kees Cook
Chrome OS & Brillo Security

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] Prefer kASLR over Hibernation Kees Cook <keescook@chromium.org> - 2016-04-06 21:50 +0200
  Re: [PATCH] Prefer kASLR over Hibernation Pavel Machek <pavel@denx.de> - 2016-04-06 22:20 +0200
    Re: [PATCH] Prefer kASLR over Hibernation Linus Torvalds <torvalds@linux-foundation.org> - 2016-04-06 23:00 +0200
      Re: [PATCH] Prefer kASLR over Hibernation Kees Cook <keescook@chromium.org> - 2016-04-06 23:30 +0200
        Re: [PATCH] Prefer kASLR over Hibernation Ingo Molnar <mingo@kernel.org> - 2016-04-06 23:50 +0200
          Re: [PATCH] Prefer kASLR over Hibernation Ingo Molnar <mingo@kernel.org> - 2016-04-07 00:00 +0200
            Re: [PATCH] Prefer kASLR over Hibernation "Rafael J. Wysocki" <rafael@kernel.org> - 2016-04-07 00:40 +0200
              Re: [PATCH] Prefer kASLR over Hibernation Ingo Molnar <mingo@kernel.org> - 2016-04-07 03:00 +0200
  Re: [PATCH] Prefer kASLR over Hibernation "Rafael J. Wysocki" <rafael@kernel.org> - 2016-04-06 23:50 +0200
    Re: [PATCH] Prefer kASLR over Hibernation Ingo Molnar <mingo@kernel.org> - 2016-04-07 00:00 +0200
      Re: [PATCH] Prefer kASLR over Hibernation "Rafael J. Wysocki" <rafael@kernel.org> - 2016-04-07 00:10 +0200
        Re: [PATCH] Prefer kASLR over Hibernation Kees Cook <keescook@chromium.org> - 2016-04-07 00:20 +0200
          Re: [PATCH] Prefer kASLR over Hibernation Paul Bolle <pebolle@tiscali.nl> - 2016-04-07 00:50 +0200
          Re: [PATCH] Prefer kASLR over Hibernation Ingo Molnar <mingo@kernel.org> - 2016-04-07 02:10 +0200
  Re: [PATCH] Prefer kASLR over Hibernation James Morse <james.morse@arm.com> - 2016-04-11 10:10 +0200
    Re: [PATCH] Prefer kASLR over Hibernation Kees Cook <keescook@chromium.org> - 2016-04-11 20:10 +0200
      Re: [PATCH] Prefer kASLR over Hibernation Geert Uytterhoeven <geert@linux-m68k.org> - 2016-04-11 20:30 +0200
        Re: [PATCH] Prefer kASLR over Hibernation Kees Cook <keescook@chromium.org> - 2016-04-11 20:50 +0200
      Re: [PATCH] Prefer kASLR over Hibernation James Morse <james.morse@arm.com> - 2016-04-12 20:00 +0200

csiph-web