Messages in this thread | | | Date | Mon, 5 Aug 2013 19:47:12 +0200 | From | Oleg Nesterov <> | Subject | Re: Linux 3.11-rc4 |
| |
On 08/05, Linus Torvalds wrote: > > On Mon, Aug 5, 2013 at 6:29 AM, Oleg Nesterov <oleg@redhat.com> wrote: > > > > I never used wine, but I am puzzled anyway. This patch really looks > > like a simple and minor bugfix. > > The patch is indeed trivial, but.. What's the locking here? > > Afaik, ptrace_detach() by the parent can race with do_exit() by the > child, and they now _both_ do flush_ptrace_hw_breakpoint().
That would be bad. And that is why exit_ptrace() doesn't do this.
But we rely on ptrace_freeze_traced(). If the child can exit (or even run), we have other problems which were hopefully fixed by 9899d11f "ensure arch_ptrace/ptrace_request can never race with SIGKILL"
> We have that whole "get tasklist_lock for writing and then > check child->ptrace" logic there exactly due to that race, no?
Exactly. But note that this code is very old. We can remove the "This child can be already killed" logic, and we can do more simplifications in ptrace paths.
In fact, some recent changes already rely on the fact the tracee can't go away, say ptrace_peek_siginfo()->spin_lock_irq(siglock) is not safe without ptrace_freeze_traced().
Oleg.
| |