# HG changeset patch # User Jan Beulich # Date 1350465790 -7200 # Node ID 4b4c0c7a6031820ab521fdd6764cb0df157f44bf # Parent 4fc87c2f31a02c770655518c9e4d389302564f00 x86/oprof: adjust off-by-one counter range checks Signed-off-by: Jan Beulich Acked-by: Keir Fraser --- a/xen/arch/x86/oprofile/xenoprof.c +++ b/xen/arch/x86/oprofile/xenoprof.c @@ -26,7 +26,7 @@ int xenoprof_arch_counter(XEN_GUEST_HAND 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_ 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;