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

Re: [Xen-devel] [PATCH] Paging and memory sharing for HVM guests



>>> Grzegorz Milos <gm281@xxxxxxxxx> 17.12.09 00:14 >>>
One more issue I see with these changes:

>--- a/drivers/xen/privcmd/privcmd.c
>+++ b/drivers/xen/privcmd/privcmd.c
>...
>@@ -236,8 +237,14 @@ static long privcmd_ioctl(struct file *f
>                   (m.addr != vma->vm_start) ||
>                   ((m.addr + (nr_pages << PAGE_SHIFT)) != vma->vm_end) ||
>                   !privcmd_enforce_singleshot_mapping(vma)) {
>-                      up_write(&mm->mmap_sem);
>-                      goto mmapbatch_out;
>+                      if (!(vma &&
>+                            (m.addr >= vma->vm_start) &&
>+                            ((m.addr + (nr_pages << PAGE_SHIFT)) <= 
>vma->vm_end) &&
>+                            (nr_pages == 1) &&
>+                            !privcmd_enforce_singleshot_mapping(vma))) {
>+                              up_write(&mm->mmap_sem);
>+                              goto mmapbatch_out;
>+                      }
>               }
> 
>               p = m.arr;

Isn't this undermining the purpose of privcmd_enforce_singleshot_mapping()?
You don't check that the eventual single page re-mapping attempt is
really due to an earlier -ENOENT failure, and hence the whole single
shot mapping checks are now pointless (though other than possibly to
enforce some minimal security I don't really know what its purpose
is/was - Keir?).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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