Re: [PATCH] ptrace: add ability to get/set signal-blocked mask

From: Oleg Nesterov
Date: Tue Apr 23 2013 - 09:14:53 EST


On 04/23, Andrew Vagin wrote:
>
> On Mon, Apr 22, 2013 at 05:07:10PM +0200, Oleg Nesterov wrote:
>
> > >
> > > I don't understand "This method is not suitable for stopped tasks"
>
> For example, a stopped process has a pending signal and this signal is
> not blocked. crtools should dump its state,

Ah, thanks, I thought that you meant restoring doesn't work...

> > > 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.
>
> __set_task_blocked executes retarget_shared_pending. I think it must be
> called here too or am I wrong?

Yes sure, this is the main reason why set_current_blocked() exists.
We do not want to "delay" a group-wide signal.

But ptrace can delay it anyway? And, assuming that other threads are
stopped too this all doesn't matter at all, every thread does
recalc_sigpending() after resume. In short, if the debugger blocks a
signal, it should know what it does.

IOW, I hope this is not a problem, and I'd like to avoid the usage of
__set_task_blocked outside of signal.c or with tsk != current.

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/