函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\smack\smack_lsm.c Create Date:2022-07-27 20:49:55
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:smack_inode_setxattr - Smack check for setting xattrs*@dentry: the object*@name: name of the attribute*@value: value of the attribute*@size: size of the value*@flags: unused* This protects the Smack attribute explicitly

函数原型:static int smack_inode_setxattr(struct dentry *dentry, const char *name, const void *value, size_t size, int flags)

返回类型:int

参数:

类型参数名称
struct dentry *dentry
const char *name
const void *value
size_tsize
intflags
1259  check_priv等于0
1260  check_import等于0
1261  check_star等于0
1262  rc等于0
1267  如果字符串比较恒等于0或字符串比较恒等于0或字符串比较恒等于0则
1270  check_priv等于1
1271  check_import等于1
1272  否则如果字符串比较恒等于0或字符串比较恒等于0则
1274  check_priv等于1
1275  check_import等于1
1276  check_star等于1
1277  否则如果字符串比较恒等于0则
1278  check_priv等于1
1279  如果size不等于TRANS_TRUE_SIZE字符串指定长度比较不等于0则rc等于负EINVAL
1282  否则rc等于ap_inode_setxattr - Determine whether an xattr may be altered*@dentry: The inode/dentry being altered*@name: The name of the xattr to be changed*@value: The value that the xattr will be changed to*@size: The size of value*@flags: The replacement flag*
1285  如果check_priv且非smack_privileged(Allow MAC configuration or state changes)则rc等于负EPERM
1288  如果rc恒等于0且check_import
1289  skp = size ? smk_import_entry(value, size) : NULL
1290  如果是错误rc等于错误
1292  否则如果skp恒等于NULLcheck_starskp恒等于smack_known_starskp恒等于smack_known_web的值则rc等于负EINVAL
1297  some inline functions to set up audit data* they do nothing if CONFIG_AUDIT is not set
1298  smk_ad_setfield_u_fs_path_dentry( & ad, dentry)
1300  如果rc恒等于0则
1301  rc等于smk_curacc - determine if current has a specific access to an object*@obj_known: a pointer to the object's Smack label entry*@mode: the access requested, in "MAY" format*@a : common audit data* This function checks the current subject label/object label
1302  rc等于smk_bu_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, MAY_WRITE, rc)
1305  返回:rc