diff options
| author | David S. Miller <davem@davemloft.net> | 2009-02-24 03:50:29 -0800 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2009-02-24 03:50:29 -0800 |
| commit | e70049b9e74267dd47e1ffa62302073487afcb48 (patch) | |
| tree | 2cd000c0751ef31c9044b020d63f278cdf4f332d /arch/x86/kernel/ptrace.c | |
| parent | d18921a0e319ab512f8186b1b1142c7b8634c779 (diff) | |
| parent | f7e603ad8f78cd3b59e33fa72707da0cbabdf699 (diff) | |
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Diffstat (limited to 'arch/x86/kernel/ptrace.c')
| -rw-r--r-- | arch/x86/kernel/ptrace.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c index 0a5df5f82fb..5a4c23d8989 100644 --- a/arch/x86/kernel/ptrace.c +++ b/arch/x86/kernel/ptrace.c @@ -810,12 +810,16 @@ static void ptrace_bts_untrace(struct task_struct *child) static void ptrace_bts_detach(struct task_struct *child) { - if (unlikely(child->bts)) { - ds_release_bts(child->bts); - child->bts = NULL; - - ptrace_bts_free_buffer(child); - } + /* + * Ptrace_detach() races with ptrace_untrace() in case + * the child dies and is reaped by another thread. + * + * We only do the memory accounting at this point and + * leave the buffer deallocation and the bts tracer + * release to ptrace_bts_untrace() which will be called + * later on with tasklist_lock held. + */ + release_locked_buffer(child->bts_buffer, child->bts_size); } #else static inline void ptrace_bts_fork(struct task_struct *tsk) {} |
