Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Search the process keyrings attached to the supplied cred for the first* matching key under RCU conditions (the caller must be holding the RCU read* lock)

Proto:key_ref_t search_cred_keyrings_rcu(struct keyring_search_context *ctx)

Type:key_ref_t

Parameter:

TypeParameterName
struct keyring_search_context *ctx
426  cred = cred
435  key_ref = NULL
436  ret = NULL
437  err = ERR_PTR( - EAGAIN)
440  If keyring private to this thread Then
441  key_ref = keyring_search_rcu - Search a keyring tree for a matching key under RCU*@keyring_ref: A pointer to the keyring with possession indicator
443  If Not IS_ERR(key_ref) Then Go to found
447  Case PTR_ERR(key_ref) == -EAGAIN
448  Case PTR_ERR(key_ref) == -ENOKEY
449  ret = key_ref
450  Break
451  Default
452  err = key_ref
453  Break
458  If keyring private to this process Then
459  key_ref = keyring_search_rcu - Search a keyring tree for a matching key under RCU*@keyring_ref: A pointer to the keyring with possession indicator
461  If Not IS_ERR(key_ref) Then Go to found
465  Case PTR_ERR(key_ref) == -EAGAIN
466  If ret Then Break
469  Case PTR_ERR(key_ref) == -ENOKEY
470  ret = key_ref
471  Break
472  Default
473  err = key_ref
474  Break
479  If keyring inherited over fork Then
480  key_ref = keyring_search_rcu - Search a keyring tree for a matching key under RCU*@keyring_ref: A pointer to the keyring with possession indicator
483  If Not IS_ERR(key_ref) Then Go to found
487  Case PTR_ERR(key_ref) == -EAGAIN
488  If ret Then Break
491  Case PTR_ERR(key_ref) == -ENOKEY
492  ret = key_ref
493  Break
494  Default
495  err = key_ref
496  Break
500  Else if user_session = Get the user session keyring if it exists, but don't create it if it* doesn't. Then
501  key_ref = keyring_search_rcu - Search a keyring tree for a matching key under RCU*@keyring_ref: A pointer to the keyring with possession indicator
503  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
505  If Not IS_ERR(key_ref) Then Go to found
509  Case PTR_ERR(key_ref) == -EAGAIN
510  If ret Then Break
513  Case PTR_ERR(key_ref) == -ENOKEY
514  ret = key_ref
515  Break
516  Default
517  err = key_ref
518  Break
523  key_ref = If ret Then ret Else err
525  found :
526  Return key_ref
Caller
NameDescribe
search_process_keyrings_rcuSearch 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.
proc_keys_show