aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2012-10-25 15:23:50 +0200
committerJan Beulich <jbeulich@suse.com>2012-10-25 15:23:50 +0200
commit48857ea790e53e6d118de72204b12fcacceabd9a (patch)
tree7a9560a879af44be0e42a04d857dde347707c353
parentb71cf4adf804df4a7c039bbdb7f0c45346add4ce (diff)
downloadxen-48857ea790e53e6d118de72204b12fcacceabd9a.tar.gz
xen-48857ea790e53e6d118de72204b12fcacceabd9a.tar.bz2
xen-48857ea790e53e6d118de72204b12fcacceabd9a.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 7c0acfde6b..dedfca97b0 100644
--- a/xen/arch/x86/oprofile/xenoprof.c
+++ b/xen/arch/x86/oprofile/xenoprof.c
@@ -26,7 +26,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;
@@ -64,7 +64,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;