Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\smack\smack_lsm.c Create Date:2022-07-28 19:20:14
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:smack_set_mnt_opts - set Smack specific mount options*@sb: the file system superblock*@mnt_opts: Smack mount options*@kern_flags: mount option from kernel space or user space*@set_kern_flags: where to store converted mount opts* Returns 0 on success, an

Proto:static int smack_set_mnt_opts(struct super_block *sb, void *mnt_opts, unsigned long kern_flags, unsigned long *set_kern_flags)

Type:int

Parameter:

TypeParameterName
struct super_block *sb
void *mnt_opts
unsigned longkern_flags
unsigned long *set_kern_flags
781  root = s_root
782  inode = d_backing_inode - Get upper or lower inode we should be using*@upper: The upper layer* This is the helper that should be used to get at the inode that will be used* if this dentry were to be opened as a file. The inode may be on the upper
783  sp = s_security
786  opts = mnt_opts
787  bool transmute = false
789  If smk_flags & Superblock flags Then Return 0
792  If (i_security == NULL) Then
793  rc = lsm_inode_alloc - allocate a composite inode blob*@inode: the inode that needs a blob* Allocate the inode blob for all the modules* Returns 0, or -ENOMEM if memory can't be allocated.
795  If rc Then Return rc
799  If Not smack_privileged(Allow MAC configuration or state changes) Then
803  If opts Then Return -EPERM
808  skp = Present a pointer to the smack label in the current task blob.
809  smk_root = skp
810  smk_default = skp
819  transmute = true
824  smk_flags |= Superblock flags
826  If opts Then
827  If fsdefault Then
829  If IS_ERR(skp) Then Return PTR_ERR(skp)
831  smk_default = skp
833  If fsfloor Then
835  If IS_ERR(skp) Then Return PTR_ERR(skp)
837  smk_floor = skp
839  If fshat Then
840  skp = smk_import_entry(fshat, 0)
841  If IS_ERR(skp) Then Return PTR_ERR(skp)
843  smk_hat = skp
845  If fsroot Then
847  If IS_ERR(skp) Then Return PTR_ERR(skp)
849  smk_root = skp
851  If fstransmute Then
853  If IS_ERR(skp) Then Return PTR_ERR(skp)
855  smk_root = skp
856  transmute = true
863  _inode_smack - initialize an inode security blob*@inode: inode to extract the info from*@skp: a pointer to the Smack label entry to use in the blob
865  If transmute Then
866  isp = smack_inode(inode)
867  smack inode flags |= directory is transmuting
870  Return 0