Re: [BUG] ptraced process waiting on syscall may return kernelinternal errnos
From: Benjamin Herrenschmidt
Date: Wed Jun 13 2007 - 18:36:39 EST
On Wed, 2007-06-13 at 19:15 +0400, Oleg Nesterov wrote:
> This breaks cancel_freezing(). Somehow we should clear TIF_SIGPENDING
> for kernel threads. Otherwise we may have subtle failures if
> try_to_freeze_tasks() fails.
The freezer is crap... news at 11. Maybe a quick hack would be to let it
clear sigpending if tsk->mm == NULL but that's ugly. Note that there's
anything pretty about the freezer anyway...
> Also, whith this change do_sigaction()->recalc_sigpending_and_wake()
> doesn't make sense any longer, yes?
Well.. why was it _and_wake() in the first place anyway ? Or do I miss
something ? Why would we need to wake a thread for which we are removing
What about something like:
t = next_thread(t);
} while (t != current);
> > @@ -385,7 +391,8 @@ int dequeue_signal(struct task_struct *t
> > }
> > }
> > }
> > - recalc_sigpending_tsk(tsk);
> > + if (likely(tsk == current))
> > + recalc_sigpending();
> In theory, flush_signals(t) needs a similar change. However, it is
> called with t == current. Perhaps it makes sense to make it
> flush_signals(void) ?
> Do you see any valid usage of flush_signals(t) when t != current ?
> (Actually, imho the same is true for dequeue_signal(). Except for
> dequeue_signal() should operate on current. Perhaps it would be a bit
> to have dequeue_signal_tsk(tsk) and dequeue_signal(void), the latter
That's been part of the discussion so far ... so yes, maybe. I also
think dequeue_signal_tsk would then only dequeue shared signals... But
then, that means signalfd would have to do a if (tsk == current) to
know which one to call...
So at the end of the day, easier to test it inside dequeue_signal().
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/