Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 8 Aug 2016 11:00:40 -0700
From: Thomas Garnier <>
To: "Rafael J. Wysocki" <>
Cc: Borislav Petkov <>, "Rafael J. Wysocki" <>, 
	Linux PM list <>, "the arch/x86 maintainers" <>, 
	Linux Kernel Mailing List <>, Yinghai Lu <>, 
	Thomas Gleixner <>, Ingo Molnar <>, "H . Peter Anvin" <>, 
	Kees Cook <>, Pavel Machek <>, 
	Kernel Hardening <>, Borislav Petkov <>
Subject: Re: [Resend][PATCH] x86/power/64: Always create temporary identity
 mapping correctly

On Mon, Aug 8, 2016 at 6:54 AM, Rafael J. Wysocki <> wrote:
> On Mon, Aug 8, 2016 at 3:40 PM, Borislav Petkov <> wrote:
>> On Mon, Aug 08, 2016 at 03:31:31PM +0200, Rafael J. Wysocki wrote:
>>> From: Rafael J. Wysocki <>
>>> 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 <>
>> Reported-by: Borislav Petkov <>
>>> Suggested-by: Yinghai Lu <>
>>> Signed-off-by: Rafael J. Wysocki <>
>>> Acked-by: Yinghai Lu <>
>>> ---
>>> 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?

I tested it on my setup couple times. Worked well.

>> Is that the only patch which needs to be tested? Ontop of which tree?
> That should be the only one on top of plain 4.8-rc1.
> If it doesn't help, we need more work to do. :-)
>> CONFIG_RANDOMIZE_MEMORY blew up s2d on my laptop here so I'll run it
>> once I have the required info from you :)
> Thanks!
> Best,
> Rafael

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.