Re: utrace-ptrace && ptrace_check_attach()

2009-10-21 Thread Oleg Nesterov
On 10/20, Roland McGrath wrote: > > > But ptrace_check_attach() needs the tracee to be already stopped. > > A bit ugly to ask the tracee to stop via UTRACE_STOP and then resume > > it if it was not already stopped. And I don't even understand how to > > do this correctly. (but again, I'll try to th

Re: utrace-ptrace && ptrace_check_attach()

2009-10-20 Thread Roland McGrath
> But ptrace_check_attach() needs the tracee to be already stopped. > A bit ugly to ask the tracee to stop via UTRACE_STOP and then resume > it if it was not already stopped. And I don't even understand how to > do this correctly. (but again, I'll try to think later). Ugly, but correct and simple.

Re: utrace-ptrace && ptrace_check_attach()

2009-10-16 Thread Oleg Nesterov
On 10/15, Roland McGrath wrote: > > > > 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. Mo

Re: utrace-ptrace && ptrace_check_attach()

2009-10-15 Thread Roland McGrath
> > 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. I

Re: utrace-ptrace && ptrace_check_attach()

2009-10-13 Thread Oleg Nesterov
On 10/12, Roland McGrath wrote: > > > Suppose a tracee is running, but for some reason it is somewhere > > inside start_callback(). utrace_control(UTRACE_STOP) can change ->flags > > and provoke report->action = UTRACE_STOP. In this case the tracee will > > stop. > > And then you check whether it's

Re: utrace-ptrace && ptrace_check_attach()

2009-10-12 Thread Roland McGrath
> Not sure I understand... This is behaviour change, no? No, I'm not talking about any change in the user-observable semantics. > Suppose a tracee is running, but for some reason it is somewhere > inside start_callback(). utrace_control(UTRACE_STOP) can change ->flags > and provoke report->action

Re: utrace-ptrace && ptrace_check_attach()

2009-10-12 Thread Oleg Nesterov
On 10/11, Roland McGrath wrote: > > > Issues with ptrace_check_attach(), > > > > - it does utrace_control(UTRACE_STOP). > > > > This is wrong, ptrace_check_attach() must be "passive", > > while utrace_control(UTRACE_STOP) can actualy stop the > > tracee. > > This is not inhere

Re: utrace-ptrace && ptrace_check_attach()

2009-10-11 Thread Roland McGrath
> Issues with ptrace_check_attach(), > > - it does utrace_control(UTRACE_STOP). > > This is wrong, ptrace_check_attach() must be "passive", > while utrace_control(UTRACE_STOP) can actualy stop the > tracee. This is not inherently problematic on its own. I'd say it'

utrace-ptrace && ptrace_check_attach()

2009-10-10 Thread Oleg Nesterov
Issues with ptrace_check_attach(), - it does utrace_control(UTRACE_STOP). This is wrong, ptrace_check_attach() must be "passive", while utrace_control(UTRACE_STOP) can actualy stop the tracee. - even if it doesn't, this is wrong when we have multiple