Done

2012/6/7 Anthony Liguori <anth...@codemonkey.ws>

> On 06/07/2012 10:53 AM, Royce Lv wrote:
>
>>     Thread eventloop:
>>               poll.poll(timeout)
>>      vdsm mainThread:
>>               os.setgroups/os.setuid/os.**setgid,etc
>>      eventloop will receive EINTR and stops, events callback can't be
>> reacted from then on.Libvirt/vdsm connection's keepalive message also
>> count
>> on this event loop, setuid/setgroups/etc will cause libvirt will close
>> connection to vdsm because of loosing keepalive message.
>>      This make libvirt/vdsm connection vulnerable to some system calls
>> like(setgroups,setuids,etc)
>>      While Libvirt's default eventloop API handled EINTR without causing
>> this problem.
>>      retry:
>>     ret = poll(fds, nfds, timeout);
>>     if (ret<  0) {
>>         EVENT_DEBUG("Poll got error event %d", errno);
>>         if (errno == EINTR) {
>>             goto retry;
>>         }
>>     Based on this please see 
>> change:http://gerrit.ovirt.**org/#/c/5113/<http://gerrit.ovirt.org/#/c/5113/>
>>
>
> I don't think your change is correct.  You catch the exception around
> run_once() but run once sets self.runningPoll = true at the beginning and
> self.runningPoll = false at the end.  If self.poll.poll() throws an
> exception, you'll leave self.runningPoll = true when you probably need to
> clear it to false.
>
> I'd suggest moving the exception handling to the run_once() function so
> you can explicitly clean up the state before returning.
>
> Regards,
>
> Anthony Liguori
>
>
>>
>>
>>
>> ______________________________**_________________
>> vdsm-devel mailing list
>> vdsm-devel@lists.fedorahosted.**org <vdsm-devel@lists.fedorahosted.org>
>> https://fedorahosted.org/**mailman/listinfo/vdsm-devel<https://fedorahosted.org/mailman/listinfo/vdsm-devel>
>>
>
>
_______________________________________________
vdsm-devel mailing list
vdsm-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/vdsm-devel

Reply via email to