mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
x86/oprof: adjust off-by-one counter range checks
Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org> xen-unstable changeset: 26061:4b4c0c7a6031 xen-unstable date: Wed Oct 17 09:23:10 UTC 2012
This commit is contained in:
1 parent
08a5c2cf7d
commit
42f8e580bc
1 file changed
+2
-2
@@ -25,7 +25,7 @@ int xenoprof_arch_counter(XEN_GUEST_HANDLE(void) arg)
|
||||
if ( copy_from_guest(&counter, arg, 1) )
|
||||
return -EFAULT;
|
||||
|
||||
if ( counter.ind > OP_MAX_COUNTER )
|
||||
if ( counter.ind >= OP_MAX_COUNTER )
|
||||
return -E2BIG;
|
||||
|
||||
counter_config[counter.ind].count = counter.count;
|
||||
@@ -63,7 +63,7 @@ int compat_oprof_arch_counter(XEN_GUEST_HANDLE(void) arg)
|
||||
if ( copy_from_guest(&counter, arg, 1) )
|
||||
return -EFAULT;
|
||||
|
||||
if ( counter.ind > OP_MAX_COUNTER )
|
||||
if ( counter.ind >= OP_MAX_COUNTER )
|
||||
return -E2BIG;
|
||||
|
||||
counter_config[counter.ind].count = counter.count;
|
||||
|
||||