summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2009-04-29 16:02:24 +0200
committerJames Morris <jmorris@namei.org>2009-04-30 09:08:48 +1000
commitecd6de3c88e8cbcad175b2eab48ba05c2014f7b6 (patch)
treeab9257bbe3f3bc9379cf0d252110f9abffba7751 /security
parent3bcac0263f0b45e67a64034ebcb69eb9abb742f4 (diff)
downloadblackbird-op-linux-ecd6de3c88e8cbcad175b2eab48ba05c2014f7b6.tar.gz
blackbird-op-linux-ecd6de3c88e8cbcad175b2eab48ba05c2014f7b6.zip
selinux: selinux_bprm_committed_creds() should wake up ->real_parent, not ->parent.
We shouldn't worry about the tracer if current is ptraced, exec() must not succeed if the tracer has no rights to trace this task after cred changing. But we should notify ->real_parent which is, well, real parent. Also, we don't need _irq to take tasklist, and we don't need parent's ->siglock to wake_up_interruptible(real_parent->signal->wait_chldexit). Since we hold tasklist, real_parent->signal must be stable. Otherwise spin_lock(siglock) is not safe too and can't help anyway. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security')
-rw-r--r--security/selinux/hooks.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 5a345115036c..39046ddd90a9 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -2371,10 +2371,8 @@ static void selinux_bprm_committed_creds(struct linux_binprm *bprm)
{
const struct task_security_struct *tsec = current_security();
struct itimerval itimer;
- struct sighand_struct *psig;
u32 osid, sid;
int rc, i;
- unsigned long flags;
osid = tsec->osid;
sid = tsec->sid;
@@ -2405,12 +2403,9 @@ static void selinux_bprm_committed_creds(struct linux_binprm *bprm)
/* Wake up the parent if it is waiting so that it can recheck
* wait permission to the new task SID. */
- read_lock_irq(&tasklist_lock);
- psig = current->parent->sighand;
- spin_lock_irqsave(&psig->siglock, flags);
- wake_up_interruptible(&current->parent->signal->wait_chldexit);
- spin_unlock_irqrestore(&psig->siglock, flags);
- read_unlock_irq(&tasklist_lock);
+ read_lock(&tasklist_lock);
+ wake_up_interruptible(&current->real_parent->signal->wait_chldexit);
+ read_unlock(&tasklist_lock);
}
/* superblock security operations */
OpenPOWER on IntegriCloud