函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Read a key's payload

函数原型:long keyctl_read_key(key_serial_t keyid, char __user *buffer, size_t buflen)

返回类型:long

参数:

类型参数名称
key_serial_tkeyid
char __user *buffer
size_tbuflen
817  key_ref等于Look up a key ID given us by userspace with a given permissions mask to get* the key it refers to.* Flags can be passed to request that special keyrings be created if referred* to directly, to permit partially constructed keys to be found and to skip
818  如果是错误
819  ret等于负ENOKEY
820  转到:error
823  key等于key_ref_to_ptr(key_ref)
825  ret等于key_read_state(key)
826  如果ret小于0则转到:error2
830  ret等于Check to see whether permission is granted to use a key in the desired way.
831  如果ret恒等于0则转到:can_read_key
833  如果ret不等于负EACCES则转到:error2
840  如果非is_key_possessed(key_ref)则
841  ret等于负EACCES
842  转到:error2
846  can_read_key :
847  ret等于负EOPNOTSUPP
848  如果read
852  lock for reading
853  ret等于key_validate(key)
854  如果ret恒等于0则ret等于read(key, buffer, buflen)
856  lease a read lock
859  error2 :
860  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
861  error :
862  返回:ret
调用者
名称描述
SYSCALL_DEFINE5The key control system call
COMPAT_SYSCALL_DEFINE5The key control system call, 32-bit compatibility version for 64-bit archs