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

Re: [Xen-devel] [PATCH 1/1] x86/hvm: prevent hvm_free_ioreq_gmfn() clobber of arbitrary memory



>>> On 13.04.15 at 18:01, <dslutz@xxxxxxxxxxx> wrote:
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -536,8 +536,9 @@ static int hvm_alloc_ioreq_gmfn(struct domain *d, 
> unsigned long *gmfn)
>  
>  static void hvm_free_ioreq_gmfn(struct domain *d, unsigned long gmfn)
>  {
> -    unsigned int i = gmfn - d->arch.hvm_domain.ioreq_gmfn.base;
> +    unsigned long i = gmfn - d->arch.hvm_domain.ioreq_gmfn.base;
>  
> +    BUG_ON(i >= sizeof(d->arch.hvm_domain.ioreq_gmfn.mask) * 8);
>      clear_bit(i, &d->arch.hvm_domain.ioreq_gmfn.mask);
>  }

I'd be happier with an ASSERT() - Andrew?

Jan


_______________________________________________
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®.