Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:smack_inode_getsecurity - get smack xattrs*@inode: the object*@name: attribute name*@buffer: where to put the result*@alloc: duplicate memory* Returns the size of the attribute or an error code

Proto:static int smack_inode_getsecurity(struct inode *inode, const char *name, void **buffer, bool alloc)

Type:int

Parameter:

TypeParameterName
struct inode *inode
const char *name
void **buffer
boolalloc
1441  ip = inode
1444  If strcmp(name, XATTR_SMACK_SUFFIX) == 0 Then isp = Present a pointer to the smack label entry in an inode blob.
1446  Else
1450  sbp = i_sb
1451  If s_magic != SOCKFS_MAGIC Then Return -EOPNOTSUPP
1454  sock = SOCKET_I(ip)
1455  If (sock == NULL || sk == NULL) Then Return -EOPNOTSUPP
1458  ssp = sk_security
1460  If strcmp(name, XATTR_SMACK_IPIN) == 0 Then isp = inbound label
1462  Else if strcmp(name, XATTR_SMACK_IPOUT) == 0 Then isp = outbound label
1464  Else Return -EOPNOTSUPP
1468  If alloc Then
1469  buffer = kstrdup - allocate space for and copy an existing string*@s: the string to duplicate*@gfp: the GFP mask used in the kmalloc() call when allocating memory* Return: newly allocated copy of @s or %NULL in case of error
1470  If ( * buffer == NULL) Then Return -ENOMEM
1474  Return strlen - Find the length of a string*@s: The string to be sized