Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:The key control system call

Proto:SYSCALL_DEFINE5(keyctl, int, option, unsigned long, arg2, unsigned long, arg3, unsigned long, arg4, unsigned long, arg5)

Type:

Parameter:Nothing

1718  Case option == ask for a keyring's ID
1719  Return Get the ID of the specified process keyring.* The requested keyring must have search permission to be found.* If successful, the ID of the requested keyring will be returned.
1722  Case option == join or start named session keyring
1723  Return Join a (named) session keyring.* Create and join an anonymous session keyring or join a named session* keyring, creating it if necessary. A named session keyring must have Search* permission for it to be joined. Session keyrings without this permit will
1725  Case option == update a key
1726  Return Update a key's data payload from the given data.* The key must grant the caller Write permission and the key type must support* updating for this to work. A negative key can be positively instantiated* with this call.* If successful, 0 will be returned
1730  Case option == voke a key
1731  Return Revoke a key.* The key must be grant the caller Write or Setattr permission for this to* work. The key type should give up its quota claim when revoked. The key* and any links to the key will be automatically garbage collected after a
1733  Case option == describe a key
1734  Return Return a description of a key to userspace
1738  Case option == clear contents of a keyring
1739  Return Clear the specified keyring, creating an empty process keyring if one of the* special keyring IDs is used.* The keyring must grant the caller Write permission and not have* KEY_FLAG_KEEP set for this to work. If successful, 0 will be returned.
1741  Case option == link a key into a keyring
1742  Return 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
1745  Case option == unlink a key from a keyring
1746  Return Unlink a key from a keyring.* The keyring must grant the caller Write permission for this to work; the key* itself need not grant the caller anything. If the last link to a key is* removed then that key will be scheduled for destruction.
1749  Case option == search for a key in a keyring
1750  Return Search the specified keyring and any keyrings it links to for a matching* key
1755  Case option == ad a key or keyring's contents
1756  Return Read a key's payload
1760  Case option == set ownership of a key
1761  Return Change the ownership of a key* The key must grant the caller Setattr permission for this to work, though* the key need not be fully instantiated yet. For the UID to be changed, or* for the GID to be changed to a group the caller is not a member of, the
1765  Case option == set perms on a key
1766  Return Change the permission mask on a key.* The key must grant the caller Setattr permission for this to work, though* the key need not be fully instantiated yet. If the caller does not have
1769  Case option == stantiate a partially constructed key
1770  Return Instantiate a key with the specified payload and link the key into the* destination keyring if one is given.* The caller must have the appropriate instantiation permit set for this to* work (see keyctl_assume_authority). No other permissions are required.
1775  Case option == gate a partially constructed key
1776  Return Negatively instantiate the key with the given timeout (in seconds) and link* the key into the destination keyring if one is given.* The caller must have the appropriate instantiation permit set for this to* work (see keyctl_assume_authority)
1780  Case option == set default request-key keyring
1781  Return Read or set the default keyring in which request_key() will cache keys and* return the old setting.* If a thread or process keyring is specified then it will be created if it* doesn't yet exist. The old setting will be returned if successful.
1783  Case option == set key timeout
1784  Return Set or clear the timeout on a key.* Either the key must grant the caller Setattr permission or else the caller* must hold an instantiation authorisation token for the key.* The timeout is either 0 to clear the timeout, or a number of seconds from
1787  Case option == assume request_key() authorisation
1788  Return Assume (or clear) the authority to instantiate the specified key
1790  Case option == get key security label
1791  Return 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,
1795  Case option == apply session keyring to parent process
1796  Return Attempt to install the calling process's session keyring on the process's* parent process.* The keyring must exist and must grant the caller LINK permission, and the* parent process must be single-threaded and must have the same effective
1798  Case option == ject a partially constructed key
1799  Return Negatively instantiate the key with the given timeout (in seconds) and error* code and link the key into the destination keyring if one is given.* The caller must have the appropriate instantiation permit set for this to
1804  Case option == stantiate a partially constructed key
1805  Return Instantiate a key with the specified multipart payload and link the key into* the destination keyring if one is given.* The caller must have the appropriate instantiation permit set for this to* work (see keyctl_assume_authority)
1811  Case option == validate a key
1812  Return Invalidate a key.* The key must be grant the caller Invalidate permission for this to work.* The key and any links to the key will be automatically garbage collected* immediately.* Keys with KEY_FLAG_KEEP set should not be invalidated.
1814  Case option == get a user's persistent keyring
1815  Return keyctl_get_persistent((uid_t)arg2, (key_serial_t)arg3)
1817  Case option == Compute Diffie-Hellman values
1818  Return keyctl_dh_compute((structkeyctl_dh_params__user * )arg2, (char__user * )arg3, (size_t)arg4, (structkeyctl_kdf_params__user * )arg5)
1822  Case option == Restrict keys allowed to link to a keyring
1823  Return Apply a restriction to a given keyring.* The caller must have Setattr permission to change keyring restrictions.* The requested type name may be a NULL pointer to reject all attempts* to link to the keyring. In this case, _restriction must also be NULL.
1827  Case option == Query public key parameters
1828  If arg3 != 0 Then Return -EINVAL
1830  Return keyctl_pkey_query((key_serial_t)arg2, (constchar__user * )arg4, (structkeyctl_pkey_query__user * )arg5)
1834  Case option == Encrypt a blob using a public key
1835  Case option == Decrypt a blob using a public key
1836  Case option == Create a public key signature
1837  Return keyctl_pkey_e_d_s(option, (conststructkeyctl_pkey_params__user * )arg2, (constchar__user * )arg3, (constvoid__user * )arg4, (void__user * )arg5)
1844  Case option == Verify a public key signature
1845  Return keyctl_pkey_verify((conststructkeyctl_pkey_params__user * )arg2, (constchar__user * )arg3, (constvoid__user * )arg4, (constvoid__user * )arg5)
1851  Case option == Move keys between keyrings
1852  Return 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
1857  Case option == Find capabilities of keyrings subsystem
1858  Return Get keyrings subsystem capabilities.
1860  Default
1861  Return -EOPNOTSUPP