aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux/hooks.c
diff options
context:
space:
mode:
authorStephen Smalley <sds@tycho.nsa.gov>2006-03-11 06:27:16 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-11 12:19:34 -0500
commit341c2d806b71cc3596afeb2d9bd26cd718e75202 (patch)
tree851a5b5cab5b836c8021bdac89a9a257887ede69 /security/selinux/hooks.c
parent4136cabff33d6d73b8daf2f2612670cc0296f844 (diff)
[PATCH] selinux: tracer SID fix
Fix SELinux to not reset the tracer SID when the child is already being traced, since selinux_ptrace is also called by proc for access checking outside of the context of a ptrace attach. Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov> Acked-by: James Morris <jmorris@namei.org> Acked-by: Chris Wright <chrisw@sous-sol.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'security/selinux/hooks.c')
-rw-r--r--security/selinux/hooks.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index b7773bf68efa..b65c201e9ff5 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -1262,7 +1262,7 @@ static int selinux_ptrace(struct task_struct *parent, struct task_struct *child)
1262 1262
1263 rc = task_has_perm(parent, child, PROCESS__PTRACE); 1263 rc = task_has_perm(parent, child, PROCESS__PTRACE);
1264 /* Save the SID of the tracing process for later use in apply_creds. */ 1264 /* Save the SID of the tracing process for later use in apply_creds. */
1265 if (!rc) 1265 if (!(child->ptrace & PT_PTRACED) && !rc)
1266 csec->ptrace_sid = psec->sid; 1266 csec->ptrace_sid = psec->sid;
1267 return rc; 1267 return rc;
1268} 1268}