projects
/
xen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b75cc14
)
arm: add bounds check on hypercall array
author
Ian Campbell
<ian.campbell@citrix.com>
Wed, 25 Jul 2012 16:39:21 +0000
(17:39 +0100)
committer
Ian Campbell
<ian.campbell@citrix.com>
Wed, 25 Jul 2012 16:39:21 +0000
(17:39 +0100)
Otherwise a guest can cause us to run off the end of the array.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
[ ijc -- switched to >= not > ]
Committed-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/traps.c
patch
|
blob
|
history
diff --git
a/xen/arch/arm/traps.c
b/xen/arch/arm/traps.c
index f2c25b582149be9f0a889580ff3bef59d824c266..d2adf4fee14caa85737a3e6f15ea38f566870722 100644
(file)
--- a/
xen/arch/arm/traps.c
+++ b/
xen/arch/arm/traps.c
@@
-479,6
+479,12
@@
static void do_trap_hypercall(struct cpu_user_regs *regs, unsigned long iss)
return;
}
+ if ( regs->r12 >= ARRAY_SIZE(arm_hypercall_table) )
+ {
+ regs->r0 = -ENOSYS;
+ return;
+ }
+
call = arm_hypercall_table[regs->r12].fn;
if ( call == NULL )
{