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

Re: [Xen-devel] [PATCH] xen: privcmd: do not return pages which we have failed to unmap



On 04/12/13 15:52, Ian Campbell wrote:
> This failure represents a hypervisor issue, but if it does occur then nothing
> good can come of returning pages which still refer to a foreign owned page
> into the general allocation pool.
> 
> Instead we are foced to leak them. Log that we have done so.
                 ^forced
> 
> The potential for failure only exists for autotranslated guest (e.g. ARM and
> x86 PVH).
[...]
> --- a/drivers/xen/privcmd.c
> +++ b/drivers/xen/privcmd.c
> @@ -533,11 +533,17 @@ static void privcmd_close(struct vm_area_struct *vma)
>  {
>       struct page **pages = vma->vm_private_data;
>       int numpgs = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
> +     int rc;
>  
>       if (!xen_feature(XENFEAT_auto_translated_physmap) || !numpgs || !pages)
>               return;
>  
> -     xen_unmap_domain_mfn_range(vma, numpgs, pages);
> +     rc = xen_unmap_domain_mfn_range(vma, numpgs, pages);
> +     if (rc < 0) {
> +             pr_crit("unable to unmap MFN range: leaking %d pages\n",
> +                     numpgs);

kfree(pages) here?  I think that would be safe. Although at this point
it probably doesn't really matter.

David

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