Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\keys\keyctl.c Create Date:2022-07-28 18:19:46
Last Modify:2020-03-18 07:59:52 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Create a link from a keyring to a key if there's no matching key in the* keyring, otherwise replace the link to the matching key with a link to the* new key.* The key must grant the caller Link permission and the the keyring must grant

Proto:long keyctl_keyring_link(key_serial_t id, key_serial_t ringid)

Type:long

Parameter:

TypeParameterName
key_serial_tid
key_serial_tringid
520  keyring_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
521  If IS_ERR(keyring_ref) Then
522  ret = PTR_ERR(keyring_ref)
523  Go to error
526  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
527  If IS_ERR(key_ref) Then
528  ret = PTR_ERR(key_ref)
529  Go to error2
532  ret = key_link - Link a key to a keyring*@keyring: The keyring to make the link in
534  key_ref_put(key_ref)
535  error2 :
536  key_ref_put(keyring_ref)
537  error :
538  Return ret
Caller
NameDescribe
SYSCALL_DEFINE5The key control system call
COMPAT_SYSCALL_DEFINE5The key control system call, 32-bit compatibility version for 64-bit archs