x86: temporarily disable SMAP to legally access user pages in kernel mode
authorFeng Wu <feng.wu@intel.com>
Mon, 12 May 2014 15:02:25 +0000 (17:02 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 12 May 2014 15:02:25 +0000 (17:02 +0200)
commit64178638ffa2271539a90197c09a3b623f9ad808
treef36c79a85a07a888f34ba977cef8054669bc2a22
parent4ee0ad72d33a4c7ae9ccc26ce1b04dad399fabe8
x86: temporarily disable SMAP to legally access user pages in kernel mode

Use STAC/CLAC to temporarily disable SMAP to allow legal accesses to
user pages in kernel mode

STAC/CLAC is not needed for compat_create_bounce_frame, since in this
chunk of code, it only accesses the pv guest's kernel stack, which is
in ring 1 for 32-bit pv guests.

Signed-off-by: Feng Wu <feng.wu@intel.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
xen/arch/x86/traps.c
xen/arch/x86/usercopy.c
xen/arch/x86/x86_64/entry.S
xen/include/asm-x86/uaccess.h
xen/include/asm-x86/x86_64/system.h