On Thu, May 29, 2014 at 3:35 PM, Ansis Atteka <[email protected]> wrote:
> On Wed, May 28, 2014 at 2:46 PM, Ben Pfaff <[email protected]> wrote:
>> On Wed, May 28, 2014 at 02:40:23PM -0700, Ansis Atteka wrote:
>>> Between fork() and execvp() calls in the process_start()
>>> function both child and parent processes share the same
>>> file descriptors. This means that, if a child process
>>> received a signal during this time interval, then it could
>>> potentially write data to a shared file descriptor.
>>>
>>> One such example is fatal signal handler, where, if
>>> child process received SIGTERM signal, then it would
>>> write data into pipe. Then a read event would occur
>>> on the other end of the pipe where parent process is
>>> listening and this would make parent process to incorrectly
>>> believe that it was the one who received SIGTERM.
>>> Also, since parent process never reads data from this
>>> pipe, then this bug would make parent process to consume
>>> 100% CPU by immediately waking up from the event loop.
>>>
>>> This patch will help to avoid this problem by blocking
>>> signals until child closes all its file descriptors.
>>>
>>> Signed-off-by: Ansis Atteka <[email protected]>
>>> Reported-by: Suganya Ramachandran <[email protected]>
>>> Issue: 1255110
>>
>> Acked-by: Ben Pfaff <[email protected]>
>>
>> It would also be OK to add a function xpthread_sigmask that calls
>> pthread_sigmask() and exits with a fatal error if it fails, since that
>> should never happen barring OVS bugs.
>
> I sent v3 version that has xpthread_sigmask().
>
> Guru, could you take a look, if I added #ifdefs properly so that
> windows builds aren't broken?
Thanks for being careful here.
Visual Studio does not have sigset_t. So, you will need to have it
inside a #ifndef _WN32.
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev