ptrace: detach wakeup fixes
cover ptrace: detach wakeup fixes
On top of misc ptrace patches in -mm.
Q: when the tracer exits we bypass ptrace_disable() and clear_tsk_thread_flag(TIF_SYSCALL_TRACE), is this correct?
Perhaps we should move this code into __ptrace_unlink?
Oleg.
Quoted 2 lines
Q: when the tracer exits we bypass
ptrace_disable()andclear_tsk_thread_flag(TIF_SYSCALL_TRACE), is this correct?
It's always been that way. It's obviously wrong in an abstract sense. But for me, ptrace today is purely about compatibility with how it's behaved in the past, however stupid that was--whenever it's been fully consistent and predictable, userland is already saddled with coping with the stupidity.
Quoted 1 line
Perhaps we should move this code into
__ptrace_unlink?
Locking nightmare. ptrace_disable can do stuff that may require the thread to be stopped like other ptrace operations require (fiddle registers), might include access_process_vm, etc. Trust me, we don't want to go there now. (In case you were looking for reasons why I'll be soon advocating reorganization to get ptrace entirely out of the tasklist_lock arena, this is a fine example of the true horror that the current data structure set-up gives us.)
Thanks,
Roland
Quoted 9 lines · Roland McGrath
Quoted 3 lines
Q: when the tracer exits we bypass
ptrace_disable()andclear_tsk_thread_flag(TIF_SYSCALL_TRACE), is this correct?It's always been that way. It's obviously wrong in an abstract sense. But for me, ptrace today is purely about compatibility with how it's behaved in the past, however stupid that was--whenever it's been fully consistent and predictable, userland is already saddled with coping with the stupidity.
Quoted 6 lines
Quoted 1 line
Perhaps we should move this code into
__ptrace_unlink?Locking nightmare.
ptrace_disablecan do stuff that may require the thread to be stopped like other ptrace operations require (fiddle registers), might includeaccess_process_vm, etc. Trust me, we don't want to go there now.
OK, thanks.
Quoted 4 lines
(In case you were looking for reasons why I'll be soon advocating reorganization to get ptrace entirely out of the
tasklist_lockarena, this is a fine example of the true horror that the current data structure set-up gives us.)
Heh. No, I don't need yet another reason to remove tasklist from ptrace ;) This would be obviously great.
(btw, I do remember I promised the cleanup, will send a bit later).
Oleg.
Quoted 2 lines · Oleg Nesterov
On top of misc ptrace patches in -mm.
Andrew, please ignore this series.
I'll resend patches 1 and 3.
Oleg.