Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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 activityDownload SCCTChinese

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:

TypeParameterName
struct dentry *opt_dentry
struct inode *inode
3269  ckp = Present a pointer to the smack label in the current task blob.
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
3289  sbp = i_sb
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
3315  Break
3316  Case s_magic == TMPFS_MAGIC
3322  Break
3323  Case s_magic == PIPEFS_MAGIC
3325  Break
3326  Case s_magic == SOCKFS_MAGIC
3332  Break
3333  Default
3335  Break
3337  smack inode flags |= de is instantiated
3338  Go to unlockandout
3348  Case s_magic == "SMAC"
3349  Case s_magic == CGROUP_SUPER_MAGIC
3350  Case s_magic == CGROUP2_SUPER_MAGIC
3359  Break
3360  Case s_magic == DEVPTS_SUPER_MAGIC
3366  final = ckp
3367  Break
3368  Case s_magic == PROC_SUPER_MAGIC
3373  Break
3374  Case s_magic == TMPFS_MAGIC
3388  Default
3397  If S_ISSOCK(i_mode) Then
3399  Break
3407  If Not (i_opflags & IOP_XATTR) Then Break
3414  If Not IS_ERR_OR_NULL(skp) Then final = skp
3420  If S_ISDIR(i_mode) Then
3451  If IS_ERR(skp) || skp == smack_known_star || skp == smack_known_web Then skp = NULL
3457  If IS_ERR(skp) || skp == smack_known_star || skp == smack_known_web Then skp = NULL
3462  dput(dp)
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 :
3474  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
3475  Return