[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20081001153823.9930.86648.stgit@warthog.procyon.org.uk>
Date: Wed, 01 Oct 2008 16:38:26 +0100
From: David Howells <dhowells@...hat.com>
To: jmorris@...ei.org
Cc: dhowells@...hat.com, penguin-kernel@...ove.SAKURA.ne.jp,
serue@...ibm.com, haradats@...il.com, k.takeda26@...il.com,
linux-security-module@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] CRED: ptrace_attach() should use the target process's mutex
ptrace_attach() should use the target process's mutex when attaching to it,
not the current (tracer) process's mutex.
Signed-off-by: David Howells <dhowells@...hat.com>
---
kernel/ptrace.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index 893a099..2ee343a 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -174,7 +174,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(¤t->cred_exec_mutex);
+ retval = mutex_lock_interruptible(&task->cred_exec_mutex);
if (retval < 0)
goto out;
@@ -218,7 +218,7 @@ repeat:
bad:
write_unlock_irqrestore(&tasklist_lock, flags);
task_unlock(task);
- mutex_unlock(¤t->cred_exec_mutex);
+ mutex_unlock(&task->cred_exec_mutex);
out:
return retval;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists