函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Get a key's the LSM security label.* The key must grant the caller View permission for this to work.* If there's a buffer, then up to buflen bytes of data will be placed into it.* If successful, the amount of information available will be returned,

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

返回类型:long

参数:

类型参数名称
key_serial_tkeyid
char __user *buffer
size_tbuflen
1495  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
1496  如果是错误
1497  如果错误不等于负EACCES则返回:错误
1502  instkey等于Search the current process's keyrings for the authorisation key for* instantiation of a key.
1503  如果是错误则返回:错误
1505  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
1507  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
1508  如果是错误则返回:错误
1512  key等于key_ref_to_ptr(key_ref)
1513  ret等于security_key_getsecurity(key, & context)
1514  如果ret恒等于0则
1517  ret等于1
1518  如果bufferbuflen大于0且copy_to_user(buffer, "", 1)不等于0则ret等于负EFAULT
1521  否则如果ret大于0则
1523  如果bufferbuflen大于0则
1524  如果buflen大于retbuflen等于ret
1527  如果copy_to_user(buffer, context, buflen)不等于0则ret等于负EFAULT
1531  释放内存
1534  key_ref_put(key_ref)
1535  返回:ret
调用者
名称描述
SYSCALL_DEFINE5The key control system call
COMPAT_SYSCALL_DEFINE5The key control system call, 32-bit compatibility version for 64-bit archs