lkml.org 
[lkml]   [2013]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ptrace: add ability to get/set signal-blocked mask
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.



\
 
 \ /
  Last update: 2013-04-22 18:01    [W:2.600 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site