lkml.org 
[lkml]   [2012]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 20/40] mn10300: Use set_current_blocked() and block_sigmask()
On 02/14, David Howells wrote:
>
> Oleg Nesterov <oleg@redhat.com> wrote:
>
> > No, only current can change ->blocked. This is even documented in
> > sigprocmask(). And more, the only correct way to change ->blocked
> > is set_current_blocked(). OK, with a couple of "I know what I am
> > doing" exceptions in kernel/signal.c.
>
> I was looking at force_sig_info() and derivatives. Is that what you refer to?

Ah, sorry, forgot to mention...

force_sig_info() (and its callers) need the cleanups and fixes. It
is almost always wrong if t != current.

For example, please look at

[PATCH 1/4] signal: give SEND_SIG_FORCED more power to beat SIGNAL_UNKILLABLE
http://marc.info/?l=linux-kernel&m=132890442717122

Hopefully we can fix all ab-users soon.



Just in case... if we race with force_sig_info() the task will be
killed anyway. But I agree, this is not nice and should be fixed.
And in any case, there are other places which assume it is safe
to read current->blocked lockless.

> If so, is it worth providing a force_sig_info_current(),
> force_sigsegv_current() and force_sig_current() to make things clearer to grep
> for, I wonder?

Yes, I think the "task_struct *t" argument should die.

Oleg.



\
 
 \ /
  Last update: 2012-02-14 19:33    [from the cache]
©2003-2011 Jasper Spaans