Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\keys\request_key_auth.c Create Date:2022-07-28 18:24:25
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Search the current process's keyrings for the authorisation key for* instantiation of a key.

Proto:struct key *key_get_instantiation_authkey(key_serial_t target_id)

Type:struct key

Parameter:

TypeParameterName
key_serial_ttarget_id
250  struct keyring_search_context ctx = {type = & The request-key authorisation key type definition., description = description, cred = current_cred - Access the current task's subjective credentials* Access the subjective credentials of the current task. RCU-safe,* since nobody else can modify it.(), cmp = By default, we keys found by getting an exact match on their descriptions., Raw match data = description, Type of lookup for this search. = Direct lookup by description. , flags = (Override NO_STATE_CHECK | Search child keyrings also ), }
263  desc_len = sprintf(description, "%x", target_id)
265  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
266  authkey_ref = Search the process keyrings attached to the supplied cred for the first* matching key in the manner of search_my_process_keyrings(), but also search* the keys attached to the assumed authorisation key using its credentials if* one is available.
267  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
269  If IS_ERR(authkey_ref) Then
270  authkey = ERR_CAST - Explicitly cast an error-valued pointer to another pointer type*@ptr: The pointer to cast.* Explicitly cast an error-valued pointer to another pointer type in such a* way as to make it clear that's what's going on.
271  If authkey == ERR_PTR( - EAGAIN) Then authkey = ERR_PTR( - ENOKEY)
273  Go to error
276  authkey = key_ref_to_ptr(authkey_ref)
277  If st_bit - Determine whether a bit is set*@nr: bit number to test*@addr: Address to start counting from Then
278  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
279  authkey = ERR_PTR( - EKEYREVOKED)
282  error :
283  Return authkey
Caller
NameDescribe
keyctl_set_timeoutSet 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
keyctl_assume_authorityAssume (or clear) the authority to instantiate the specified key
keyctl_get_securityGet 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,
keyctl_describe_keyReturn a description of a key to userspace