函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Instantiate a key with the specified payload and link the key into the* destination keyring if one is given.* The caller must have the appropriate instantiation permit set for this to* work (see keyctl_assume_authority). No other permissions are required.

函数原型:long keyctl_instantiate_key_common(key_serial_t id, struct iov_iter *from, key_serial_t ringid)

返回类型:long

参数:

类型参数名称
key_serial_tid
struct iov_iter *from
key_serial_tringid
1100  cred等于current_cred - Access the current task's subjective credentials* Access the subjective credentials of the current task. RCU-safe,* since nobody else can modify it.()
1103  plen等于如果fromiov_iter_count(from)否则0
1107  kenter("%d,,%zu,%d", id, plen, ringid)
1109  如果非plenfrom = NULL
1112  ret等于负EINVAL
1113  如果plen大于1024乘1024减1则转到:error
1118  ret等于负EPERM
1119  instkey等于 assumed request_key authority
1120  如果非instkey则转到:error
1123  rka等于data[0]
1124  如果 key serial number 不等于id则转到:error
1128  payload = NULL
1130  如果from
1131  ret等于负ENOMEM
1132  payload等于kvmalloc(plen, GFP_KERNEL)
1133  如果非payload则转到:error
1136  ret等于负EFAULT
1137  如果非copy_from_iter_full(payload, plen, from)则转到:error2
1143  ret等于Get the destination keyring for instantiation and check that the caller has* Write permission on it.
1144  如果ret小于0则转到:error2
1148  ret等于key_instantiate_and_link - Instantiate a key and link it into the keyring.*@key: The key to instantiate.*@data: The data to use to instantiate the keyring.*@datalen: The length of @data.*@keyring: Keyring to create a link in on success (or NULL).
1151  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
1155  如果ret恒等于0则Change the request_key authorisation key on the current process.
1158  error2 :
1159  如果payload
1160  memzero_explicit - Fill a region of memory (e
1161  kvfree() - Free memory.*@addr: Pointer to allocated memory.* kvfree frees memory allocated by any of vmalloc(), kmalloc() or kvmalloc().* It is slightly more efficient to use kfree() or vfree() if you are certain* that you know which one to use.
1163  error :
1164  返回:ret
调用者
名称描述
keyctl_instantiate_keyInstantiate a key with the specified payload and link the key into the* destination keyring if one is given.* The caller must have the appropriate instantiation permit set for this to* work (see keyctl_assume_authority). No other permissions are required.
keyctl_instantiate_key_iovInstantiate a key with the specified multipart payload and link the key into* the destination keyring if one is given.* The caller must have the appropriate instantiation permit set for this to* work (see keyctl_assume_authority)
compat_keyctl_instantiate_key_iovInstantiate a key with the specified compatibility multipart payload and* link the key into the destination keyring if one is given.* The caller must have the appropriate instantiation permit set for this to* work (see keyctl_assume_authority)