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


Groups > linux.kernel > #1460961

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

From Jiri Kosina <jikos@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH v1] x86/power/64: Restore processor state before using per-cpu variables
Date 2016-08-12 08:10 +0200
Message-ID <s5dPj-6mv-19@gated-at.bofh.it> (permalink)
References <s56b8-13L-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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@google.com>

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

	Reported-by: Jiri Kosina <jkosina@suse.cz>
	Tested-by: Jiri Kosina <jkosina@suse.cz>

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

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


Thread

[PATCH v1] x86/power/64: Restore processor state before using per-cpu variables Thomas Garnier <thgarnie@google.com> - 2016-08-12 00:00 +0200
  Re: [PATCH v1] x86/power/64: Restore processor state before using  per-cpu variables Borislav Petkov <bp@suse.de> - 2016-08-12 08:00 +0200
    Re: [PATCH v1] x86/power/64: Restore processor state before using  per-cpu variables "Rafael J. Wysocki" <rafael@kernel.org> - 2016-08-12 13:20 +0200
      Re: [PATCH v1] x86/power/64: Restore processor state before using  per-cpu variables Thomas Garnier <thgarnie@google.com> - 2016-08-12 18:10 +0200
        Re: [PATCH v1] x86/power/64: Restore processor state before using  per-cpu variables Borislav Petkov <bp@suse.de> - 2016-08-12 19:50 +0200
  Re: [PATCH v1] x86/power/64: Restore processor state before using  per-cpu variables Jiri Kosina <jikos@kernel.org> - 2016-08-12 08:10 +0200
    Re: [PATCH v1] x86/power/64: Restore processor state before using  per-cpu variables Jiri Kosina <jikos@kernel.org> - 2016-08-12 11:30 +0200
      Re: [PATCH v1] x86/power/64: Restore processor state before using  per-cpu variables Thomas Garnier <thgarnie@google.com> - 2016-08-12 18:10 +0200
  Re: [PATCH v1] x86/power/64: Restore processor state before using  per-cpu variables Pavel Machek <pavel@denx.de> - 2016-08-12 08:30 +0200

csiph-web