From: Keir Fraser Subject: Re: [PATCH] x86/oprof: adjust off-by-one counter range checks Date: Wed, 17 Oct 2012 10:02:43 +0100 Message-ID: References: <507E89AF02000078000A1E10@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <507E89AF02000078000A1E10@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich , xen-devel List-Id: xen-devel@lists.xenproject.org On 17/10/2012 09:34, "Jan Beulich" wrote: > Signed-off-by: Jan Beulich Acked-by: Keir Fraser > --- a/xen/arch/x86/oprofile/xenoprof.c > +++ b/xen/arch/x86/oprofile/xenoprof.c > @@ -24,7 +24,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; > @@ -61,7 +61,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; > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel