summaryrefslogtreecommitdiff
path: root/arch/arm/xen
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2015-09-11 19:18:28 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2015-09-11 19:18:28 +0100
commitc2172ce2303051764829d4958bd50a11ada0590f (patch)
treec465594496072249d2ad8ee4642f7c5dcd57e139 /arch/arm/xen
parenta4a5a7379e4ca03c192b732d61e446994eb67bbc (diff)
parent0b61f2c0f37983c98ed4207f3f5e265938371b68 (diff)
Merge branch 'uaccess' into fixes
Diffstat (limited to 'arch/arm/xen')
-rw-r--r--arch/arm/xen/hypercall.S15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/arm/xen/hypercall.S b/arch/arm/xen/hypercall.S
index f00e08075938..10fd99c568c6 100644
--- a/arch/arm/xen/hypercall.S
+++ b/arch/arm/xen/hypercall.S
@@ -98,8 +98,23 @@ ENTRY(privcmd_call)
mov r1, r2
mov r2, r3
ldr r3, [sp, #8]
+ /*
+ * Privcmd calls are issued by the userspace. We need to allow the
+ * kernel to access the userspace memory before issuing the hypercall.
+ */
+ uaccess_enable r4
+
+ /* r4 is loaded now as we use it as scratch register before */
ldr r4, [sp, #4]
__HVC(XEN_IMM)
+
+ /*
+ * Disable userspace access from kernel. This is fine to do it
+ * unconditionally as no set_fs(KERNEL_DS)/set_fs(get_ds()) is
+ * called before.
+ */
+ uaccess_disable r4
+
ldm sp!, {r4}
ret lr
ENDPROC(privcmd_call);