ptrace_wake_up() clears tracee-exit_code, this is racy and no longer needed.
This was needed previously when -exit_code was checked by callbacks. Now
-exit_code is only used by do_wait(), and we have no reasons to clear it.
If the tracee exits or stops again -exit_code will be correctly updated
I still didn't find the time to read the code around set/clear -reporting,
it is subtle and needs a fresh head.
Ok. I had remembered that your earlier reviews included review all use of
memory barriers in utrace, so I didn't realize this stuff needed review.
But at least, I think
ptrace_attach_task:
engine = utrace_attach_task(CREATE | EXCLUSIVE);
err = utrace_set_events();
WARN_ON(err !tracee-exit_state);
Looks correct but it is not. utrace_attach_task() can return EINPROGRESS.
utrace_set_events can, yes.
Note that start_callback/etc sets
And then you check whether it's really in a proper ptrace stop, see that it
isn't, and use UTRACE_RESUME.
So far I don't really understand to do this correctly, but OK.
I guess I'm missing something because it seems trivial to me.
ptrace_check_attach() does verify we are ptracer. If the
Not sure. Suppose we call utrace_control(old, UTRACE_DETACH) right
before the tracee utrace_get_signal() calls ops-report_signal().
Then utrace_control() returns -EINPROGRESS. If it returned 0, then
ops-report_signal will not be called. If that's not so, utrace_control
is broken.
Tracee, finish_callback() path:
if (action == UTRACE_DETACH)
engine-ops = utrace_detached_ops;
utrace-reporting = NULL;
no barries, no utrace-lock() in between.
Tracer, utrace_barrier() under utrace-lock:
if (engine-ops == utrace_detached_ops)
ptrace_detach(sig) checks valid_signal(sig) to detect the
explicit detach and passes bool voluntary to ptrace_wake_up().
ptrace_detach_task() does. ptrace_detach() has already bailed out
if !valid_signal(sig) was really pass in from userland.
valid_signal(0) = true, so this is
Roland, do you see other problems with attach/detach which
should be fixed before v1?
It depends what v1 means, on which I am not entirely clear. If you just
mean being work-alike compatible, then the proof is in the pudding.
Like I said before, if it doesn't regress any tests, including on