Function report |
Source Code:security\keys\process_keys.c |
Create Date:2022-07-28 18:22:05 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:Look up the user and user session keyrings for the current process's UID,* creating them if they don't exist.
Proto:int look_up_user_keyrings(struct key **_user_keyring, struct key **_user_session_keyring)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct key ** | _user_keyring | |
| struct key ** | _user_session_keyring |
| 77 | 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.() |
| 78 | user_ns = current_user_ns() |
| 82 | uid = from_kuid(user_ns, real UID of the task ) |
| 91 | If IS_ERR(reg_keyring) Then Return PTR_ERR(reg_keyring) |
| 95 | ret = 0 |
| 102 | uid_keyring_r = keyring_search - Search the supplied keyring tree for a matching key*@keyring: The root of the keyring tree to be searched |
| 104 | kdebug("_uid %p", uid_keyring_r) |
| 105 | If uid_keyring_r == ERR_PTR( - EAGAIN) Then |
| 111 | If IS_ERR(uid_keyring) Then |
| 112 | ret = PTR_ERR(uid_keyring) |
| 113 | Go to error |
| 115 | Else if IS_ERR(uid_keyring_r) Then |
| 116 | ret = PTR_ERR(uid_keyring_r) |
| 117 | Go to error |
| 118 | Else |
| 124 | session_keyring_r = keyring_search - Search the supplied keyring tree for a matching key*@keyring: The root of the keyring tree to be searched |
| 126 | kdebug("_uid_ses %p", session_keyring_r) |
| 127 | If session_keyring_r == ERR_PTR( - EAGAIN) Then |
| 133 | If IS_ERR(session_keyring) Then |
| 134 | ret = PTR_ERR(session_keyring) |
| 135 | Go to error_release |
| 142 | If ret < 0 Then Go to error_release_session |
| 149 | If ret < 0 Then Go to error_release_session |
| 151 | Else if IS_ERR(session_keyring_r) Then |
| 152 | ret = PTR_ERR(session_keyring_r) |
| 153 | Go to error_release |
| 154 | Else |
| 160 | If _user_session_keyring Then _user_session_keyring = session_keyring |
| 164 | If _user_keyring Then _user_keyring = uid_keyring |
| 168 | kleave(" = 0") |
| 169 | Return 0 |
| 171 | error_release_session : |
| 173 | error_release : |
| 175 | error : |
| 178 | Return ret |
| Name | Describe |
|---|---|
| lookup_user_key | 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 |
| init_root_keyring | Make sure that root's user and user-session keyrings exist. |
| call_sbin_request_key | Request userspace finish the construction of a key* - execute "/sbin/request-key |
| construct_get_dest_keyring | Get the appropriate destination keyring for the request.* The keyring selected is returned with an extra reference upon it which the* caller must release. |
| 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 |