Function report |
Source Code:security\smack\smack_lsm.c |
Create Date:2022-07-28 19:23:17 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:smack_d_instantiate - Make sure the blob is correct on an inode*@opt_dentry: dentry where inode will be attached*@inode: the object* Set the inode's security blob if it hasn't been done already.
Proto:static void smack_d_instantiate(struct dentry *opt_dentry, struct inode *inode)
Type:void
Parameter:
Type | Parameter | Name |
---|---|---|
struct dentry * | opt_dentry | |
struct inode * | inode |
3272 | transflag = 0 |
3276 | If (inode == NULL) Then Return |
3279 | isp = smack_inode(inode) |
3281 | mutex_lock( & itialization lock ) |
3286 | If smack inode flags & de is instantiated Then Go to unlockandout |
3290 | sbsp = s_security |
3295 | final = smk_default |
3303 | If parent directory == opt_dentry Then |
3305 | Case s_magic == CGROUP_SUPER_MAGIC |
3306 | Case s_magic == CGROUP2_SUPER_MAGIC |
3312 | smk_root = smack_known_star |
3313 | smk_default = smack_known_star |
3314 | label of the fso = smk_root |
3315 | Break |
3316 | Case s_magic == TMPFS_MAGIC |
3323 | Case s_magic == PIPEFS_MAGIC |
3326 | Case s_magic == SOCKFS_MAGIC |
3331 | label of the fso = smack_known_star |
3332 | Break |
3333 | Default |
3334 | label of the fso = smk_root |
3335 | Break |
3337 | smack inode flags |= de is instantiated |
3338 | Go to unlockandout |
3349 | Case s_magic == CGROUP_SUPER_MAGIC |
3350 | Case s_magic == CGROUP2_SUPER_MAGIC |
3358 | final = smack_known_star |
3359 | Break |
3360 | Case s_magic == DEVPTS_SUPER_MAGIC |
3368 | Case s_magic == PROC_SUPER_MAGIC |
3373 | Break |
3374 | Case s_magic == TMPFS_MAGIC |
3380 | final = smack_known_star |
3388 | Default |
3398 | final = smack_known_star |
3399 | Break |
3412 | dp = get a reference to a dentry |
3414 | If Not IS_ERR_OR_NULL(skp) Then final = skp |
3430 | If smack inode flags & smack was transmuted Then |
3431 | smack inode flags &= ~smack was transmuted |
3432 | rc = __vfs_setxattr(dp, inode, XATTR_NAME_SMACKTRANSMUTE, TRANS_TRUE, TRANS_TRUE_SIZE, 0) |
3436 | Else |
3437 | rc = __vfs_getxattr(dp, inode, XATTR_NAME_SMACKTRANSMUTE, trattr, TRANS_TRUE_SIZE) |
3440 | If rc >= 0 && strncmp(trattr, TRANS_TRUE, TRANS_TRUE_SIZE) != 0 Then rc = -EINVAL |
3444 | If rc >= 0 Then transflag = directory is transmuting |
3451 | If IS_ERR(skp) || skp == smack_known_star || skp == smack_known_web Then skp = NULL |
3454 | label of the task = skp |
3457 | If IS_ERR(skp) || skp == smack_known_star || skp == smack_known_web Then skp = NULL |
3460 | label of the mmap domain = skp |
3463 | Break |
3466 | If (final == NULL) Then label of the fso = ckp |
3468 | Else label of the fso = final |
3471 | smack inode flags |= de is instantiated | transflag |
3473 | unlockandout : |
3475 | Return |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |