Re: [PATCH v1] x86/power/64: Restore processor state before using per-cpu variables

From: Jiri Kosina
Date: Fri Aug 12 2016 - 02:01:38 EST


On Thu, 11 Aug 2016, Thomas Garnier wrote:

> Restore the processor state before calling any other function to ensure
> per-cpu variables can be used with KASLR memory randomization.
>
> Tracing functions use per-cpu variables (gs based) and one was called
> just before restoring the processor state fully. It resulted in a double
> fault when both the tracing & the exception handler functions tried to
> use a per-cpu variable.
>
> Signed-off-by: Thomas Garnier <thgarnie@xxxxxxxxxx>

Alright, this did the trick, thanks :) Feel free to add

Reported-by: Jiri Kosina <jkosina@xxxxxxx>
Tested-by: Jiri Kosina <jkosina@xxxxxxx>

One thing is still beyond me though ... how the heck this doesn't happen
without DEBUG_LOCK_ALLOC? The percpu area pointer should be corrupted
nevertheless, shouldn't it?

Thanks,

--
Jiri Kosina
SUSE Labs