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

Re: [Xen-devel] [PATCH] libxc: Pause & unpause the domain in xc_mem_event_enable based on its initial state.

>>> As indicated in the other thread regarding the correctness of
>>> properly refcounting in Xen, this is a TOCTOU race which doesn't fix
>>> the problem in the general case.
>>> It is my opinion that this is impossible to correctly fix in the dom0
>>> userspace.
>>> ~Andrew
>> Indeed, if there are multiple user-space tools trying to control the domain,
>this patch doesn't ensure safety. That issue is however beyond the scope of
>what this patch is trying to address.
>> This patch doesn't even assure safety for two threads in the same process
>dealing with the same domain.
>> ~Andrew
>Again, I agree, but that is not the problem this patch is trying to address. 
>problem you are talking about is present xc_mem_event_enable as it is right
>now as well. For example, nothing prevents another thread/process from
>unpausing the domain while the event ring setup is in process. This patch
>operates with the same assumption the current code makes: only one user-
>space tool/thread is controlling the domain at a time. This patch just ensures
>the domain is left in the same state it was before the function was called.


Thanks for finding this issue. I agree with Andrew that the correct fix for 
this can only be done in the hypervisor. But I see there is some resistance to 
that. If that is the case, I would hope this patch is accepted. You could also 
add a comment about this situation in xenctrl.h.


Xen-devel mailing list



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