Skip to content
Commit 5861bbfc authored by Roland McGrath's avatar Roland McGrath
Browse files

tracehook: fix CLONE_PTRACE

In the change in commit 09a05394

, 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: default avatarEduardo Habkost <ehabkost@redhat.com>
Signed-off-by: default avatarRoland McGrath <roland@redhat.com>
parent 685d87f7
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment