[libvirt] [PATCH] virNetClientSetTLSSession: Restore original signal mask

Martin Kletzander mkletzan at redhat.com
Wed Mar 19 17:41:47 UTC 2014


On Wed, Mar 19, 2014 at 06:29:01PM +0100, Michal Privoznik wrote:
> Currently, we use pthread_sigmask(SIG_BLOCK, ...) prior to calling
> poll(). This is okay, as we don't want poll() to be interrupted.
> However, then - immediately as we fall out from the poll() - we try to
> restore the original sigmask - again using SIG_BLOCK. But as the man
> page says, SIG_BLOCK adds signals to the signal mask:
>
> SIG_BLOCK
>       The set of blocked signals is the union of the current set and the set argument.
>
> Therefore, when restoring the original mask, we need to completely
> overwrite the one we set earlier and hence we should be using:
>
> SIG_SETMASK
>       The set of blocked signals is set to the argument set.
>

And indeed we do that on all other places.

> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> ---
>

ACK.

> Notes:
>     This is a very old bug. It's worth backporting onto all maint branches we have.
>

Go ahead (but only the active ones ;-) )

Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140319/f8211db4/attachment-0001.sig>


More information about the libvir-list mailing list