aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux/hooks.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/selinux/hooks.c')
-rw-r--r--security/selinux/hooks.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 099bbd07732f..6ae19fd28be5 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -1301,10 +1301,8 @@ static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dent
1301 1301
1302 /* Try to obtain a transition SID. */ 1302 /* Try to obtain a transition SID. */
1303 isec->sclass = inode_mode_to_security_class(inode->i_mode); 1303 isec->sclass = inode_mode_to_security_class(inode->i_mode);
1304 rc = security_transition_sid(isec->task_sid, 1304 rc = security_transition_sid(isec->task_sid, sbsec->sid,
1305 sbsec->sid, 1305 isec->sclass, NULL, &sid);
1306 isec->sclass,
1307 &sid);
1308 if (rc) 1306 if (rc)
1309 goto out_unlock; 1307 goto out_unlock;
1310 isec->sid = sid; 1308 isec->sid = sid;
@@ -1579,7 +1577,7 @@ static int may_create(struct inode *dir,
1579 return rc; 1577 return rc;
1580 1578
1581 if (!newsid || !(sbsec->flags & SE_SBLABELSUPP)) { 1579 if (!newsid || !(sbsec->flags & SE_SBLABELSUPP)) {
1582 rc = security_transition_sid(sid, dsec->sid, tclass, &newsid); 1580 rc = security_transition_sid(sid, dsec->sid, tclass, NULL, &newsid);
1583 if (rc) 1581 if (rc)
1584 return rc; 1582 return rc;
1585 } 1583 }
@@ -2061,7 +2059,8 @@ static int selinux_bprm_set_creds(struct linux_binprm *bprm)
2061 } else { 2059 } else {
2062 /* Check for a default transition on this program. */ 2060 /* Check for a default transition on this program. */
2063 rc = security_transition_sid(old_tsec->sid, isec->sid, 2061 rc = security_transition_sid(old_tsec->sid, isec->sid,
2064 SECCLASS_PROCESS, &new_tsec->sid); 2062 SECCLASS_PROCESS, NULL,
2063 &new_tsec->sid);
2065 if (rc) 2064 if (rc)
2066 return rc; 2065 return rc;
2067 } 2066 }
@@ -2532,7 +2531,7 @@ static int selinux_inode_init_security(struct inode *inode, struct inode *dir,
2532 else if (!newsid || !(sbsec->flags & SE_SBLABELSUPP)) { 2531 else if (!newsid || !(sbsec->flags & SE_SBLABELSUPP)) {
2533 rc = security_transition_sid(sid, dsec->sid, 2532 rc = security_transition_sid(sid, dsec->sid,
2534 inode_mode_to_security_class(inode->i_mode), 2533 inode_mode_to_security_class(inode->i_mode),
2535 &newsid); 2534 qstr, &newsid);
2536 if (rc) { 2535 if (rc) {
2537 printk(KERN_WARNING "%s: " 2536 printk(KERN_WARNING "%s: "
2538 "security_transition_sid failed, rc=%d (dev=%s " 2537 "security_transition_sid failed, rc=%d (dev=%s "
@@ -4845,7 +4844,7 @@ static int selinux_msg_queue_msgsnd(struct msg_queue *msq, struct msg_msg *msg,
4845 * message queue this message will be stored in 4844 * message queue this message will be stored in
4846 */ 4845 */
4847 rc = security_transition_sid(sid, isec->sid, SECCLASS_MSG, 4846 rc = security_transition_sid(sid, isec->sid, SECCLASS_MSG,
4848 &msec->sid); 4847 NULL, &msec->sid);
4849 if (rc) 4848 if (rc)
4850 return rc; 4849 return rc;
4851 } 4850 }