Skip to content

Commit 5c7c179

Browse files
marmarekgregkh
authored andcommitted
x86/xen: allow userspace access during hypercalls
commit c54590cac51db8ab5fd30156bdaba34af915e629 upstream. Userspace application can do a hypercall through /dev/xen/privcmd, and some for some hypercalls argument is a pointers to user-provided structure. When SMAP is supported and enabled, hypervisor can't access. So, lets allow it. The same applies to HYPERVISOR_dm_op, where additionally privcmd driver carefully verify buffer addresses. Cc: stable@vger.kernel.org Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> Reviewed-by: Juergen Gross <jgross@suse.com> [HYPERVISOR_dm_op dropped - not present until 4.11] Signed-off-by: Juergen Gross <jgross@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 78dce99 commit 5c7c179

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

arch/x86/include/asm/xen/hypercall.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343

4444
#include <asm/page.h>
4545
#include <asm/pgtable.h>
46+
#include <asm/smap.h>
4647

4748
#include <xen/interface/xen.h>
4849
#include <xen/interface/sched.h>
@@ -213,10 +214,12 @@ privcmd_call(unsigned call,
213214
__HYPERCALL_DECLS;
214215
__HYPERCALL_5ARG(a1, a2, a3, a4, a5);
215216

217+
stac();
216218
asm volatile("call *%[call]"
217219
: __HYPERCALL_5PARAM
218220
: [call] "a" (&hypercall_page[call])
219221
: __HYPERCALL_CLOBBER5);
222+
clac();
220223

221224
return (long)__res;
222225
}

0 commit comments

Comments
 (0)