diff options
Diffstat (limited to 'security/smack/smack_lsm.c')
-rw-r--r-- | security/smack/smack_lsm.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index 048d92e81a34..2160e88a2e4e 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c | |||
@@ -3036,7 +3036,8 @@ static void smack_d_instantiate(struct dentry *opt_dentry, struct inode *inode) | |||
3036 | * of the superblock. | 3036 | * of the superblock. |
3037 | */ | 3037 | */ |
3038 | if (opt_dentry->d_parent == opt_dentry) { | 3038 | if (opt_dentry->d_parent == opt_dentry) { |
3039 | if (sbp->s_magic == CGROUP_SUPER_MAGIC) { | 3039 | switch (sbp->s_magic) { |
3040 | case CGROUP_SUPER_MAGIC: | ||
3040 | /* | 3041 | /* |
3041 | * The cgroup filesystem is never mounted, | 3042 | * The cgroup filesystem is never mounted, |
3042 | * so there's no opportunity to set the mount | 3043 | * so there's no opportunity to set the mount |
@@ -3044,8 +3045,19 @@ static void smack_d_instantiate(struct dentry *opt_dentry, struct inode *inode) | |||
3044 | */ | 3045 | */ |
3045 | sbsp->smk_root = &smack_known_star; | 3046 | sbsp->smk_root = &smack_known_star; |
3046 | sbsp->smk_default = &smack_known_star; | 3047 | sbsp->smk_default = &smack_known_star; |
3048 | isp->smk_inode = sbsp->smk_root; | ||
3049 | break; | ||
3050 | case TMPFS_MAGIC: | ||
3051 | /* | ||
3052 | * What about shmem/tmpfs anonymous files with dentry | ||
3053 | * obtained from d_alloc_pseudo()? | ||
3054 | */ | ||
3055 | isp->smk_inode = smk_of_current(); | ||
3056 | break; | ||
3057 | default: | ||
3058 | isp->smk_inode = sbsp->smk_root; | ||
3059 | break; | ||
3047 | } | 3060 | } |
3048 | isp->smk_inode = sbsp->smk_root; | ||
3049 | isp->smk_flags |= SMK_INODE_INSTANT; | 3061 | isp->smk_flags |= SMK_INODE_INSTANT; |
3050 | goto unlockandout; | 3062 | goto unlockandout; |
3051 | } | 3063 | } |