All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Andrey Vagin <avagin@openvz.org>
Cc: linux-kernel@vger.kernel.org, Roland McGrath <roland@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Michael Kerrisk <mtk.manpages@gmail.com>,
	Pavel Emelyanov <xemul@parallels.com>,
	Cyrill Gorcunov <gorcunov@openvz.org>
Subject: Re: [PATCH] ptrace: add ability to get/set signal-blocked mask
Date: Mon, 22 Apr 2013 17:07:10 +0200	[thread overview]
Message-ID: <20130422150710.GA30858@redhat.com> (raw)
In-Reply-To: <20130422145704.GA30029@redhat.com>

On 04/22, Oleg Nesterov wrote:
>
> On 04/22, Andrey Vagin wrote:
> >
> > +	case PTRACE_SETSIGMASK:
> > +	{
> > +		sigset_t new_set;
> > +
> > +		if (addr != sizeof(sigset_t)) {
> > +			ret = -EINVAL;
> > +			break;
> > +		}
> > +
> > +		if (copy_from_user(&new_set, datavp, sizeof(sigset_t))) {
> > +			ret = -EFAULT;
> > +			break;
> > +		}
> > +
> > +		sigdelsetmask(&new_set, sigmask(SIGKILL)|sigmask(SIGSTOP));
> > +
> > +		spin_lock_irq(&child->sighand->siglock);
> > +		__set_task_blocked(child, &new_set);
> > +		spin_unlock_irq(&child->sighand->siglock);
>
> No, please don't...
>
> set_current_blocked/__set_task_blocked assume that tsk == current.
> If nothing else, note recalc_sigpending() in __set_task_blocked().
>
> I don't understand "This method is not suitable for stopped tasks"
> from the changelog, but if you really need PTRACE_SETSIGMASK just
> change ->blocked under siglock and do recalc_sigpending_tsk(child).
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

actually this is not necessary, the tracee will do recalc_sigpending()
after resume. But perhaps a comment make sense.

Oleg.


  parent reply	other threads:[~2013-04-22 15:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-22  9:53 [PATCH] ptrace: add ability to get/set signal-blocked mask Andrey Vagin
     [not found] ` <20130422145704.GA30029@redhat.com>
2013-04-22 15:07   ` Oleg Nesterov [this message]
2013-04-23 10:59     ` Andrew Vagin
2013-04-23 13:11       ` Oleg Nesterov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130422150710.GA30858@redhat.com \
    --to=oleg@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=avagin@openvz.org \
    --cc=gorcunov@openvz.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=roland@redhat.com \
    --cc=xemul@parallels.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.