函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Return a description of a key to userspace

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

返回类型:long

参数:

类型参数名称
key_serial_tkeyid
char __user *buffer
size_tbuflen
654  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
655  如果是错误
658  如果错误恒等于负EACCES
660  如果非是错误
670  ret等于错误
671  转到:error
674  okay :
675  key等于key_ref_to_ptr(key_ref)
676  desclen等于strlen - Find the length of a string*@s: The string to be sized
679  ret等于负ENOMEM
680  infobuf等于kasprintf(GFP_KERNEL, "%s;%d;%d;%08x;", name, from_kuid_munged(current_user_ns(), uid), from_kgid_munged(current_user_ns(), gid), access permissions )
686  如果非infobuf则转到:error2
688  infolen等于strlen - Find the length of a string*@s: The string to be sized
689  ret等于infolendesclen加1
692  如果bufferbuflen大于等于ret
693  如果copy_to_user(buffer, infobuf, infolen)不等于0或copy_to_user(buffer + infolen, description, desclen + 1)不等于0则ret等于负EFAULT
699  释放内存
700  error2 :
701  key_ref_put(key_ref)
702  error :
703  返回:ret
调用者
名称描述
SYSCALL_DEFINE5The key control system call
COMPAT_SYSCALL_DEFINE5The key control system call, 32-bit compatibility version for 64-bit archs