Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@osdl.org>2005-11-09 11:37:57 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2005-11-10 21:22:08 -0800
commit082d52c56f642d21b771a13221068d40915a1409 (patch)
treef9aaef5204923c5dd1e2a6ca2080b940ecd1d9b8
parent24547e2e65e534598580945b791f3ce7777f829b (diff)
[PATCH] Fix ptrace self-attach rule
Before we did CLONE_THREAD, the way to check whether we were attaching to ourselves was to just check "current == task", but with CLONE_THREAD we should check that the thread group ID matches instead. Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--kernel/ptrace.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index 019e04ec065a..fcfc4568b45f 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -152,7 +152,7 @@ int ptrace_attach(struct task_struct *task)
retval = -EPERM;
if (task->pid <= 1)
goto bad;
- if (task == current)
+ if (task->tgid == current->tgid)
goto bad;
/* the same process cannot be attached many times */
if (task->ptrace & PT_PTRACED)