On 10/28, Roland McGrath wrote:
>
> I've made a new branch, utrace-cleanup.
> This forks from utrace-indirect and has:
>
> 26fefca utrace: sticky resume action

Can't comment right now, need to read the code.

But I feel this is "right" change.

> 28b2774 utrace: remove ->stopped field

Again, need to actually read the code, but.

Afaics, we can't just remove utrace_finish_jctl() and the similar code in
utrace_stop(). We need

        void utrace_finish_jctl(void)
        {
                struct utrace *utrace = task_utrace_struct(current);
                /*
                 * While in TASK_STOPPED, we can be considered safely stopped by
                 * utrace_do_stop(). Make sure we can do nothing until the 
tracer
                 * drops utrace->lock
                 */
                if (unlikely(__fatal_signal_pending()))
                        spin_unlock_wait(utrace->lock);
        }

and utrace_stop() should do the same.

Otherwise, the killed tracee can start another reporting loop and
list_for_each() can race with, say, utrace_reset(DETACH)->utrace_reset().
More generally, if the tracer sees "it is stopped" under utrace->lock,
the tracee must be "really" stopped until we drop utrace->lock(), it
must not "escape" from utrace_stop() or do_signal_stop().

Right?

Oleg.

Reply via email to