summaryrefslogtreecommitdiffstats
path: root/arch/arm/xen
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-09-14 12:24:10 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2015-09-14 12:24:10 -0700
commit57e6bbcb4beb4c87aa93e78a1db08fdaab9ee65f (patch)
treedc71e7f1d448f3e3dceaeabeee506d4328f50a65 /arch/arm/xen
parent6ff33f3902c3b1c5d0db6b1e2c70b6d76fba357f (diff)
parentc2172ce2303051764829d4958bd50a11ada0590f (diff)
downloadlinux-stable-57e6bbcb4beb4c87aa93e78a1db08fdaab9ee65f.tar.gz
linux-stable-57e6bbcb4beb4c87aa93e78a1db08fdaab9ee65f.tar.bz2
linux-stable-57e6bbcb4beb4c87aa93e78a1db08fdaab9ee65f.zip
Merge branch 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm
Pull ARM fixes from Russell King: "A number of fixes for the merge window, fixing a number of cases missed when testing the uaccess code, particularly cases which only show up with certain compiler versions" * 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm: ARM: 8431/1: fix alignement of __bug_table section entries arm/xen: Enable user access to the kernel before issuing a privcmd call ARM: domains: add memory dependencies to get_domain/set_domain ARM: domains: thread_info.h no longer needs asm/domains.h ARM: uaccess: fix undefined instruction on ARMv7M/noMMU ARM: uaccess: remove unneeded uaccess_save_and_disable macro ARM: swpan: fix nwfpe for uaccess changes ARM: 8429/1: disable GCC SRA optimization
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);