lkml.org 
[lkml]   [2007]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    SubjectRe: [BUG] ptraced process waiting on syscall may return kernel internal errnos
    From
    Date
    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
    signals ?

    What about something like:

    do {
    rm_from_queue_full(&mask, &t->pending);
    - recalc_sigpending_and_wake(t);
    t = next_thread(t);
    } while (t != current);
    + recalc_sigpending();

    > > @@ -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
    > always
    > called with t == current. Perhaps it makes sense to make it
    > flush_signals(void) ?

    Agreed.

    > Do you see any valid usage of flush_signals(t) when t != current ?
    >
    > (Actually, imho the same is true for dequeue_signal(). Except for
    > signalfd.c
    > dequeue_signal() should operate on current. Perhaps it would be a bit
    > cleaner
    > to have dequeue_signal_tsk(tsk) and dequeue_signal(void), the latter
    > does
    > recalc_sigpending).

    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().

    Ben.


    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/
    \
     
     \ /
      Last update: 2007-06-14 00:39    [W:8.416 / U:0.116 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site