Skip to content

Commit

Permalink
ptrace: ptrace_attach: fix the usage of ->cred_exec_mutex
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Oleg Nesterov authored and James Morris committed Apr 27, 2009
1 parent ce8a742 commit cad81bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,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;

Expand Down Expand Up @@ -232,7 +232,7 @@ int ptrace_attach(struct task_struct *task)
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;
}
Expand Down

0 comments on commit cad81bc

Please sign in to comment.