aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2009-04-27 01:41:34 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2009-05-08 15:45:05 -0700
commit2c9ca2baf3f368a2b747124d39bf31b779eb7571 (patch)
tree2d3dc50134612270220a40cad0adcb914b95adad
parentf63f698922fc8f57a11d7eba1db8ee6e7519ea7f (diff)
ptrace: ptrace_attach: fix the usage of ->cred_exec_mutex
commit cad81bc2529ab8c62b6fdc83a1c0c7f4a87209eb upstream. ptrace_attach() needs task->cred_exec_mutex, not current->cred_exec_mutex. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Acked-by: Roland McGrath <roland@redhat.com> Acked-by: David Howells <dhowells@redhat.com> Signed-off-by: James Morris <jmorris@namei.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--kernel/ptrace.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index c9cf48b21f05..dc3b98ef10bb 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -186,7 +186,7 @@ int ptrace_attach(struct task_struct *task)
/* Protect exec's credential calculations against our interference;
* SUID, SGID and LSM creds get determined differently under ptrace.
*/
- retval = mutex_lock_interruptible(&current->cred_exec_mutex);
+ retval = mutex_lock_interruptible(&task->cred_exec_mutex);
if (retval < 0)
goto out;
@@ -230,7 +230,7 @@ repeat:
bad:
write_unlock_irqrestore(&tasklist_lock, flags);
task_unlock(task);
- mutex_unlock(&current->cred_exec_mutex);
+ mutex_unlock(&task->cred_exec_mutex);
out:
return retval;
}