Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Move a link to a key from one keyring to another, displacing any matching* key from the destination keyring.* The key must grant the caller Link permission and both keyrings must grant* the caller Write permission

Proto:long keyctl_keyring_move(key_serial_t id, key_serial_t from_ringid, key_serial_t to_ringid, unsigned int flags)

Type:long

Parameter:

TypeParameterName
key_serial_tid
key_serial_tfrom_ringid
key_serial_tto_ringid
unsigned intflags
601  If flags & ~Do not displace from the to-keyring Then Return -EINVAL
604  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
605  If IS_ERR(key_ref) Then Return PTR_ERR(key_ref)
608  from_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
609  If IS_ERR(from_ref) Then
610  ret = PTR_ERR(from_ref)
611  Go to error2
614  to_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
615  If IS_ERR(to_ref) Then
616  ret = PTR_ERR(to_ref)
617  Go to error3
620  ret = key_move - Move a key from one keyring to another*@key: The key to move*@from_keyring: The keyring to remove the link from
623  key_ref_put(to_ref)
624  error3 :
625  key_ref_put(from_ref)
626  error2 :
627  key_ref_put(key_ref)
628  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