函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:keyring_restrict - Look up and apply a restriction to a keyring*@keyring_ref: The keyring to be restricted*@type: The key type that will provide the restriction checker.*@restriction: The restriction options to apply to the keyring

函数原型:int keyring_restrict(key_ref_t keyring_ref, const char *type, const char *restriction)

返回类型:int

参数:

类型参数名称
key_ref_tkeyring_ref
const char *type
const char *restriction
1029  struct key_type * restrict_type = NULL
1031  ret等于0
1033  keyring等于key_ref_to_ptr(keyring_ref)
1034  key_check(keyring)
1036  如果 type of key 不等于key_type_keyring则返回:负ENOTDIR
1039  如果非type
1040  restrict_link等于keyring_restriction_alloc(strict_link_reject - Give -EPERM to restrict link*@keyring: The keyring being added to.*@type: The type of key being added.*@payload: The payload of the key intended to be added.*@restriction_key: Keys providing additional data for evaluating restriction.)
1041  否则
1042  restrict_type等于Find and lock the specified key type against removal.* We return with the sem read-locked if successful. If the type wasn't* available -ENOKEY is returned instead.
1044  如果是错误则返回:错误
1047  如果非lookup_restriction
1048  ret等于负ENOENT
1049  转到:error
1052  restrict_link等于lookup_restriction(restriction)
1055  如果是错误
1056  ret等于错误
1057  转到:error
1060  lock for writing
1061  lock for writing
1063  如果 This is set on a keyring to restrict the addition of a link to a key * to it. If this structure isn't provided then it is assumed that the * keyring is open to any addition. It is ignored for non-keyring * keys. Only set this value using keyring_restrict(ret等于负EEXIST
1065  否则如果Check for restriction cycles that would prevent keyring garbage collection.* keyring_serialise_restrict_sem must be held.ret等于负EDEADLK
1067  否则 This is set on a keyring to restrict the addition of a link to a key * to it. If this structure isn't provided then it is assumed that the * keyring is open to any addition. It is ignored for non-keyring * keys. Only set this value using keyring_restrict(等于restrict_link
1070  lease a write lock
1071  lease a write lock
1073  如果ret小于0则
1074  key_put - Discard a reference to a key.*@key: The key to discard a reference from.* Discard a reference to a key, and when all the references are gone, we* schedule the cleanup task to come and pull it out of the tree in process
1075  释放内存
1078  error :
1079  如果restrict_typeUnlock a key type locked by key_type_lookup().
1082  返回:ret
调用者
名称描述
keyctl_restrict_keyringApply a restriction to a given keyring.* The caller must have Setattr permission to change keyring restrictions.* The requested type name may be a NULL pointer to reject all attempts* to link to the keyring. In this case, _restriction must also be NULL.