aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2012-10-29 09:02:33 +0100
committerJan Beulich <jbeulich@suse.com>2012-10-29 09:02:33 +0100
commit42f8e580bcc2c7585c9ebdaec09c8079bd5fb2ef (patch)
treec1d47a86f1e572f5627a5eae40be4ded8f95a1f1
parent08a5c2cf7dd908db57be8268aa8dd7a80ae17de7 (diff)
downloadxen-42f8e580bcc2c7585c9ebdaec09c8079bd5fb2ef.tar.gz
xen-42f8e580bcc2c7585c9ebdaec09c8079bd5fb2ef.tar.bz2
xen-42f8e580bcc2c7585c9ebdaec09c8079bd5fb2ef.zip
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
-rw-r--r--xen/arch/x86/oprofile/xenoprof.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xen/arch/x86/oprofile/xenoprof.c b/xen/arch/x86/oprofile/xenoprof.c
index b926b19e6d..c00f193c26 100644
--- a/xen/arch/x86/oprofile/xenoprof.c
+++ b/xen/arch/x86/oprofile/xenoprof.c
@@ -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;