[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LRH.2.00.1608091121120.19185@gjva.wvxbf.pm>
Date: Tue, 9 Aug 2016 11:23:07 +0200 (CEST)
From: Jiri Kosina <jikos@...nel.org>
To: "Rafael J. Wysocki" <rjw@...ysocki.net>
cc: Linux PM list <linux-pm@...r.kernel.org>,
Thomas Garnier <thgarnie@...gle.com>,
the arch/x86 maintainers <x86@...nel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Yinghai Lu <yinghai@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H . Peter Anvin" <hpa@...or.com>,
Kees Cook <keescook@...omium.org>, Pavel Machek <pavel@....cz>,
Kernel Hardening <kernel-hardening@...ts.openwall.com>,
Borislav Petkov <bpetkov@...e.de>
Subject: Re: [Resend][PATCH] x86/power/64: Always create temporary identity
mapping correctly
On Mon, 8 Aug 2016, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
>
> The low-level resume-from-hibernation code on x86-64 uses
> kernel_ident_mapping_init() to create the temoprary identity mapping,
> but that function assumes that the offset between kernel virtual
> addresses and physical addresses is aligned on the PGD level.
>
> However, with a randomized identity mapping base, it may be aligned
> on the PUD level and if that happens, the temporary identity mapping
> created by set_up_temporary_mappings() will not reflect the actual
> kernel identity mapping and the image restoration will fail as a
> result (leading to a kernel panic most of the time).
>
> To fix this problem, rework kernel_ident_mapping_init() to support
> unaligned offsets between KVA and PA up to the PMD level and make
> set_up_temporary_mappings() use it as approprtiate.
>
> Reported-by: Thomas Garnier <thgarnie@...gle.com>
> Suggested-by: Yinghai Lu <yinghai@...nel.org>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> Acked-by: Yinghai Lu <yinghai@...nel.org>
> ---
>
> This is sort of urgent, because hibernation doesn't work with KASLR on x86-64
> in 4.8-rc1 AFAICS and this should make them work together again.
>
> Unless anyone sees any problems with it, I'll queue it up for 4.8-rc2.
>
> Thomas, would it be possible to test it with KASLR enabled, please?
Unfortunately this applied on top of -rc1 still doesn't solve the reboot
after reading hibernation image (I'd guess due to triple fault) with
CONFIG_RANDOMIZE_MEMORY=y on my system.
With CONFIG_RANDOMIZE_MEMORY=n, the system resumes correctly.
--
Jiri Kosina
SUSE Labs
Powered by blists - more mailing lists