diff options
author | Roland McGrath <roland@redhat.com> | 2008-08-07 23:55:03 (GMT) |
---|---|---|
committer | Roland McGrath <roland@redhat.com> | 2008-08-08 00:18:47 (GMT) |
commit | 5861bbfcc10fc0358abf52c7d22850c8d180f0b0 (patch) | |
tree | 066a66bd465741973879675b150f517032adcbfa /include/linux/ptrace.h | |
parent | 685d87f7ccc649ab92b55e18e507a65d0e694eb9 (diff) | |
download | linux-fsl-qoriq-5861bbfcc10fc0358abf52c7d22850c8d180f0b0.tar.xz |
tracehook: fix CLONE_PTRACE
In the change in commit 09a05394fe2448a4139b014936330af23fa7ec83, I
overlooked two nits in the logic and this broke using CLONE_PTRACE
when PTRACE_O_TRACE* are not being used.
A parent that is itself traced at all but not using PTRACE_O_TRACE*,
using CLONE_PTRACE would have its new child fail to be traced.
A parent that is not itself traced at all that uses CLONE_PTRACE
(which should be a no-op in this case) would confuse the bookkeeping
and lead to a crash at exit time.
This restores the missing checks and fixes both failure modes.
Reported-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Roland McGrath <roland@redhat.com>
Diffstat (limited to 'include/linux/ptrace.h')
-rw-r--r-- | include/linux/ptrace.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index fd31756..ea7416c 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h @@ -172,7 +172,7 @@ static inline void ptrace_init_task(struct task_struct *child, bool ptrace) child->ptrace = 0; if (unlikely(ptrace)) { child->ptrace = current->ptrace; - __ptrace_link(child, current->parent); + ptrace_link(child, current->parent); } } |