Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:smk_fetch - Fetch the smack label from a file.*@name: type of the label (attribute)*@ip: a pointer to the inode*@dp: a pointer to the dentry* Returns a pointer to the master list entry for the Smack label,

Proto:static struct smack_known *smk_fetch(const char *name, struct inode *ip, struct dentry *dp)

Type:struct smack_known

Parameter:

TypeParameterName
const char *name
struct inode *ip
struct dentry *dp
285  struct smack_known * skp = NULL
287  If Not (i_opflags & IOP_XATTR) Then Return ERR_PTR( - EOPNOTSUPP)
290  buffer = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
291  If (buffer == NULL) Then Return ERR_PTR( - ENOMEM)
294  rc = __vfs_getxattr(dp, ip, name, buffer, SMK_LONGLABEL)
295  If rc < 0 Then skp = ERR_PTR(rc)
297  Else if rc == 0 Then skp = NULL
299  Else skp = smk_import_entry(buffer, rc)
302  kfree(buffer)
304  Return skp
Caller
NameDescribe
smack_d_instantiatesmack_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.