| Function report | 
| Source Code: security\keys\keyring.c | Create Date:2022-07-28 18:17:52 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:Search a tree of keyrings that point to other keyrings up to the maximum* depth.
Proto:static bool search_nested_keyrings(struct key *keyring, struct keyring_search_context *ctx)
Type:bool
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| struct key * | keyring | |
| struct keyring_search_context * | ctx | 
| 680 | sp = 0 | 
| 682 | kenter("{%d},{%s,%s}", key serial number , name, description) | 
| 691 | If description Then Finalise an index key to include a part of the description actually in the* index key, to set the domain tag and to calculate the hash. | 
| 697 | If Type of lookup for this search. == Iterative search. || keyring_compare_object(keyring, & index_key) Then | 
| 699 | Internal stuff = 2 | 
| 701 | Case iterator(keyring_key_to_ptr(keyring), ctx) == 1 | 
| 702 | Go to found | 
| 703 | Case iterator(keyring_key_to_ptr(keyring), ctx) == 2 | 
| 704 | Return false | 
| 705 | Default | 
| 706 | Break | 
| 710 | Internal stuff = 0 | 
| 713 | descend_to_keyring : | 
| 714 | kdebug("descend to %d", key serial number ) | 
| 715 | If status flags (change with bitops) & ( 1 << set if key has been invalidated | 1 << set if key had been revoked ) Then Go to not_this_keyring | 
| 733 | If Not (flags & Search child keyrings also ) Then Go to not_this_keyring | 
| 737 | If Not ptr Then Go to not_this_keyring | 
| 740 | If assoc_array_ptr_is_shortcut(ptr) Then | 
| 746 | If (index_key[0] & ASSOC_ARRAY_FAN_MASK) != 0 Then Go to not_this_keyring | 
| 750 | node = assoc_array_ptr_to_node(ptr) | 
| 751 | Go to begin_node | 
| 754 | node = assoc_array_ptr_to_node(ptr) | 
| 756 | If Not assoc_array_ptr_is_meta(ptr) Then Go to begin_node | 
| 759 | descend_to_node : | 
| 763 | kdebug("descend") | 
| 764 | If assoc_array_ptr_is_shortcut(ptr) Then | 
| 767 | BUG_ON(!assoc_array_ptr_is_node(ptr)) | 
| 769 | node = assoc_array_ptr_to_node(ptr) | 
| 771 | begin_node : | 
| 772 | kdebug("begin_node") | 
| 773 | slot = 0 | 
| 774 | ascend_to_node : | 
| 776 | When slot < Number of slots per node cycle | 
| 779 | If assoc_array_ptr_is_meta(ptr) && back_pointer Then Go to descend_to_node | 
| 782 | If Not keyring_ptr_is_keyring(ptr) Then Continue | 
| 785 | key = keyring_ptr_to_key(ptr) | 
| 788 | If flags & Give an error on excessive depth Then | 
| 792 | Go to not_this_keyring | 
| 796 | If Not (flags & Don't check permissions ) && key_task_permission(make_key_ref(key, possessed), cred, Require permission to search (keyring) or find (key) ) < 0 Then Continue | 
| 805 | sp++ | 
| 809 | Go to descend_to_keyring | 
| 815 | ptr = READ_ONCE(back_pointer) | 
| 816 | slot = parent_slot | 
| 818 | If ptr && assoc_array_ptr_is_shortcut(ptr) Then | 
| 820 | ptr = READ_ONCE(back_pointer) | 
| 821 | slot = parent_slot | 
| 823 | If Not ptr Then Go to not_this_keyring | 
| 825 | node = assoc_array_ptr_to_node(ptr) | 
| 826 | slot++ | 
| 832 | If back_pointer Then | 
| 834 | Go to ascend_to_node | 
| 840 | not_this_keyring : | 
| 842 | If sp <= 0 Then | 
| 843 | kleave(" = false") | 
| 844 | Return false | 
| 848 | sp-- | 
| 852 | kdebug("ascend to %d [%d]", key serial number , slot) | 
| 853 | Go to ascend_to_node | 
| 856 | found : | 
| 857 | key = key_ref_to_ptr(result) | 
| 859 | If Not (flags & Don't update times ) Then | 
| 865 | kleave(" = true") | 
| 866 | Return true | 
| Name | Describe | 
|---|---|
| keyring_search_rcu | keyring_search_rcu - Search a keyring tree for a matching key under RCU*@keyring_ref: A pointer to the keyring with possession indicator | 
| keyring_detect_cycle | See if a cycle will will be created by inserting acyclic tree B in acyclic* tree A at the topmost level (ie: as a direct child of A).* Since we are adding B to A at the top level, checking for cycles should just | 
| Source code conversion tool public plug-in interface | X | 
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |