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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 4796ddd4e721..a6238281186a 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -2529,7 +2529,10 @@ static int selinux_inode_init_security(struct inode *inode, struct inode *dir,
2529 sid = tsec->sid; 2529 sid = tsec->sid;
2530 newsid = tsec->create_sid; 2530 newsid = tsec->create_sid;
2531 2531
2532 if (!newsid || !(sbsec->flags & SE_SBLABELSUPP)) { 2532 if ((sbsec->flags & SE_SBINITIALIZED) &&
2533 (sbsec->behavior == SECURITY_FS_USE_MNTPOINT))
2534 newsid = sbsec->mntpoint_sid;
2535 else if (!newsid || !(sbsec->flags & SE_SBLABELSUPP)) {
2533 rc = security_transition_sid(sid, dsec->sid, 2536 rc = security_transition_sid(sid, dsec->sid,
2534 inode_mode_to_security_class(inode->i_mode), 2537 inode_mode_to_security_class(inode->i_mode),
2535 &newsid); 2538 &newsid);