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

Re: [Xen-devel] [PATCH] gnttab: lock the left grant table earlier in __gnttab_unmap_common()



>>> On 11.11.13 at 03:14, Anthony Liguori <anthony@xxxxxxxxxxxxx> wrote:
> On Sun, Nov 10, 2013 at 6:07 PM, Matt Wilson <msw@xxxxxxxxx> wrote:
>> From: Matt Wilson <msw@xxxxxxxxxx>
>>
>> Luckily today maptrack_limit never shrinks. But if at some point in
>> the future this were to change, checking maptrack_limit without
>> holding the grant table spinlock would no longer be safe.
> 
> Reviewed-by: Anthony Liguori <aliguori@xxxxxxxxxx>
> 
> The commit doesn't mention it, but this problem could cause the
> function to fail with "Bad handle" even when the handle is valid (in
> theory at least).

But only if the growing of the table races the operation here.
Which ought to be impossible, as we're dealing with an unmap
here (i.e. the handle must have been established earlier). And
even if not impossible, it's pointless - checking against the
lower (pre-growth) value is fine here, as guests are supposed
to not issue requests resulting in growth in parallel with
requests utilizing the grown table (and they also should be
unable to, as they can't possibly know of the "bigger" handle,
which would be returned to them only after the growing
completed).

Or else - what am I overlooking?

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