[CRIU] [PATCH] criu: restore blocked signals correctly

Andrey Vagin avagin at openvz.org
Mon Oct 12 01:03:54 PDT 2015


On Oct 12, 2015 10:50, "Pavel Emelyanov" <xemul at parallels.com> wrote:
>
> On 10/09/2015 10:47 PM, Andrey Vagin wrote:
> > From: Andrew Vagin <avagin at openvz.org>
> >
> > We need to use SIG_SETMASK instead of SIG_BLOCK.
>
> Why?
>
> > SIG_SETMASK
> >       The set of blocked signals is set to the argument set.

Because sig_setmask sets a specified mask, sig_blockmask adds signals from
a specified mask to the current mask

> >
> > Signed-off-by: Andrew Vagin <avagin at openvz.org>
> > ---
> >  namespaces.c | 2 +-
> >  sysctl.c     | 2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/namespaces.c b/namespaces.c
> > index 7d0690c..4233c59 100644
> > --- a/namespaces.c
> > +++ b/namespaces.c
> > @@ -1201,7 +1201,7 @@ int stop_usernsd(void)
> >                       ret = -1;
> >
> >               usernsd_pid = 0;
> > -             sigprocmask(SIG_BLOCK, &oldmask, NULL);
> > +             sigprocmask(SIG_SETMASK, &oldmask, NULL);
> >
> >               if (ret != 0)
> >                       pr_err("UNS: daemon exited abnormally\n");
> > diff --git a/sysctl.c b/sysctl.c
> > index 7dd08ba..489c599 100644
> > --- a/sysctl.c
> > +++ b/sysctl.c
> > @@ -314,7 +314,7 @@ static int __userns_sysctl_op(void *arg, int
proc_fd, pid_t pid)
> >               kill(worker, SIGKILL);
> >               goto out;
> >       }
> > -     sigprocmask(SIG_BLOCK, &oldmask, NULL);
> > +     sigprocmask(SIG_SETMASK, &oldmask, NULL);
> >
> >       if (!WIFEXITED(status) || WEXITSTATUS(status)) {
> >               pr_err("worker failed: %d\n", status);
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvz.org/pipermail/criu/attachments/20151012/a33a3d54/attachment.html>


More information about the CRIU mailing list