projects
/
GitHub
/
LineageOS
/
android_kernel_samsung_universal7580.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ac111bf
)
Fix ptrace self-attach rule
author
Linus Torvalds
<torvalds@g5.osdl.org>
Wed, 9 Nov 2005 19:33:07 +0000
(11:33 -0800)
committer
Linus Torvalds
<torvalds@g5.osdl.org>
Wed, 9 Nov 2005 19:33:07 +0000
(11:33 -0800)
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>
kernel/ptrace.c
patch
|
blob
|
blame
|
history
diff --git
a/kernel/ptrace.c
b/kernel/ptrace.c
index 5b8dd98a230e442c1ec46adc968acb60dfdb74ae..b88d4186cd7ac2733c3adf231d5b4daa4e14b0a9 100644
(file)
--- a/
kernel/ptrace.c
+++ b/
kernel/ptrace.c
@@
-155,7
+155,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)