diff options
author | Jan Beulich <jbeulich@suse.com> | 2012-10-17 11:23:10 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2012-10-17 11:23:10 +0200 |
commit | b6f2a5303932b0877706feb3221028dbed95b001 (patch) | |
tree | be70730a031840f06bfd7adfe97f33eb5c791a84 /xen/arch/x86/oprofile | |
parent | 915ef37d7cc8fcac5b37eb0b40c693754fcd12ab (diff) | |
download | xen-b6f2a5303932b0877706feb3221028dbed95b001.tar.gz xen-b6f2a5303932b0877706feb3221028dbed95b001.tar.bz2 xen-b6f2a5303932b0877706feb3221028dbed95b001.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>
Diffstat (limited to 'xen/arch/x86/oprofile')
-rw-r--r-- | xen/arch/x86/oprofile/xenoprof.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/xen/arch/x86/oprofile/xenoprof.c b/xen/arch/x86/oprofile/xenoprof.c index 69476f2659..a10d3597e8 100644 --- a/xen/arch/x86/oprofile/xenoprof.c +++ b/xen/arch/x86/oprofile/xenoprof.c @@ -24,7 +24,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; @@ -61,7 +61,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; |