函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:smack_key_permission - Smack access on a key*@key_ref: gets to the object*@cred: the credentials to use*@perm: requested key permissions* Return 0 if the task has read and write to the object,* an error code otherwise

函数原型:static int smack_key_permission(key_ref_t key_ref, const struct cred *cred, unsigned perm)

返回类型:int

参数:

类型参数名称
key_ref_tkey_ref
const struct cred *cred
unsignedperm
4248  tkp等于Present a pointer to the smack label entry in an task blob.
4249  request等于0
4255  如果perm按位与All the above permissions 的反则返回:负EINVAL
4258  keyp等于key_ref_to_ptr(key_ref)
4259  如果(keyp == NULL)则返回:负EINVAL
4265  如果( security data for this key == NULL)则返回:0
4270  如果(tkp == NULL)则返回:负EACCES
4273  如果smack_privileged_cred - are all privilege requirements met by cred*@cap: The requested capability*@cred: the credential to use* Is the task privileged and allowed to be privileged* by the onlycap rule.则返回:0
4277  some inline functions to set up audit data* they do nothing if CONFIG_AUDIT is not set
4278  key等于 key serial number
4279  key_desc等于description
4281  如果perm按位与Require permission to read content 按位或Require permission to search (keyring) or find (key) 按位或Require permission to view attributes 的值则request或等于MAY_READ
4283  如果perm按位与Require permission to update / modify 按位或Require permission to link 按位或Require permission to change attributes 的值则request或等于MAY_WRITE
4285  rc等于smk_access(tkp, security data for this key , request, & ad)
4286  rc等于smk_bu_note("key access", tkp, security data for this key , request, rc)
4287  返回:rc