Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:smack_inode_setsecurity - set smack xattrs*@inode: the object*@name: attribute name*@value: attribute value*@size: size of the attribute*@flags: unused* Sets the named attribute in the appropriate blob* Returns 0 on success, or an error code

Proto:static int smack_inode_setsecurity(struct inode *inode, const char *name, const void *value, size_t size, int flags)

Type:int

Parameter:

TypeParameterName
struct inode *inode
const char *name
const void *value
size_tsize
intflags
2687  nsp = smack_inode(inode)
2690  rc = 0
2692  If value == NULL || size > SMK_LONGLABEL || size == 0 Then Return -EINVAL
2695  skp = smk_import_entry(value, size)
2696  If IS_ERR(skp) Then Return PTR_ERR(skp)
2699  If strcmp(name, XATTR_SMACK_SUFFIX) == 0 Then
2700  label of the fso = skp
2701  smack inode flags |= de is instantiated
2702  Return 0
2707  If s_magic != SOCKFS_MAGIC Then Return -EOPNOTSUPP
2710  sock = SOCKET_I(inode)
2711  If (sock == NULL || sk == NULL) Then Return -EOPNOTSUPP
2714  ssp = sk_security
2716  If strcmp(name, XATTR_SMACK_IPIN) == 0 Then inbound label = skp
2718  Else if strcmp(name, XATTR_SMACK_IPOUT) == 0 Then
2719  outbound label = skp
2720  If sk_family == PF_INET Then
2727  Else Return -EOPNOTSUPP
2731  If sk_family == PF_INET6 Then smk_ipv6_port_label - Smack port access table management*@sock: socket*@address: address* Create or update the port list entry
2735  Return 0
Caller
NameDescribe
smack_inode_notifysecctxThere used to be a smack_release_secctx hook* that did nothing back when hooks were in a vector.* Now that there's a list such a hook adds cost.