summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-04-07 19:12:10 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2019-04-07 19:12:10 +0300
commit3b04689147085f5c8f47835d1c7e48203cba80d3 (patch)
tree09839161ab2316f923bb54f889687e9824629be7 /arch
parent82331a70cc3c2901c4ae36ff88d5a28f6d14df32 (diff)
parent42d8644bd77dd2d747e004e367cb0c895a606f39 (diff)
downloadlinux-3b04689147085f5c8f47835d1c7e48203cba80d3.tar.xz
Merge tag 'for-linus-5.1b-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip
Pull xen fixes from Juergen Gross: "One minor fix and a small cleanup for the xen privcmd driver" * tag 'for-linus-5.1b-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen: Prevent buffer overflow in privcmd ioctl xen: use struct_size() helper in kzalloc()
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/include/asm/xen/hypercall.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/include/asm/xen/hypercall.h b/arch/x86/include/asm/xen/hypercall.h
index de6f0d59a24f..2863c2026655 100644
--- a/arch/x86/include/asm/xen/hypercall.h
+++ b/arch/x86/include/asm/xen/hypercall.h
@@ -206,6 +206,9 @@ xen_single_call(unsigned int call,
__HYPERCALL_DECLS;
__HYPERCALL_5ARG(a1, a2, a3, a4, a5);
+ if (call >= PAGE_SIZE / sizeof(hypercall_page[0]))
+ return -EINVAL;
+
asm volatile(CALL_NOSPEC
: __HYPERCALL_5PARAM
: [thunk_target] "a" (&hypercall_page[call])