[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] x86/oprof: adjust off-by-one counter range checks


  • To: Jan Beulich <JBeulich@xxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxx>
  • From: Keir Fraser <keir@xxxxxxx>
  • Date: Wed, 17 Oct 2012 10:02:43 +0100
  • Delivery-date: Wed, 17 Oct 2012 09:03:05 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>
  • Thread-index: Ac2sRirWNfr/L0ehLUaAQSqAlvBy4w==
  • Thread-topic: [Xen-devel] [PATCH] x86/oprof: adjust off-by-one counter range checks

On 17/10/2012 09:34, "Jan Beulich" <JBeulich@xxxxxxxx> wrote:

> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Acked-by: Keir Fraser <keir@xxxxxxx>

> --- 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@xxxxxxxxxxxxx
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.