diff options
Diffstat (limited to 'security/selinux/hooks.c')
-rw-r--r-- | security/selinux/hooks.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 6f637d2678ac..e276eb468536 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
@@ -2525,7 +2525,10 @@ static int selinux_inode_init_security(struct inode *inode, struct inode *dir, | |||
2525 | sid = tsec->sid; | 2525 | sid = tsec->sid; |
2526 | newsid = tsec->create_sid; | 2526 | newsid = tsec->create_sid; |
2527 | 2527 | ||
2528 | if (!newsid || !(sbsec->flags & SE_SBLABELSUPP)) { | 2528 | if ((sbsec->flags & SE_SBINITIALIZED) && |
2529 | (sbsec->behavior == SECURITY_FS_USE_MNTPOINT)) | ||
2530 | newsid = sbsec->mntpoint_sid; | ||
2531 | else if (!newsid || !(sbsec->flags & SE_SBLABELSUPP)) { | ||
2529 | rc = security_transition_sid(sid, dsec->sid, | 2532 | rc = security_transition_sid(sid, dsec->sid, |
2530 | inode_mode_to_security_class(inode->i_mode), | 2533 | inode_mode_to_security_class(inode->i_mode), |
2531 | &newsid); | 2534 | &newsid); |