Function report |
Source Code:security\keys\gc.c |
Create Date:2022-07-28 18:15:00 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:Reaper for unused keys.
Proto:static void key_garbage_collector(struct work_struct *work)
Type:void
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct work_struct * | work |
| 184 | kenter("[%lx,%x]", key_gc_flags, gc_state) |
| 187 | If limit > Delay between key revocation/expiry in seconds Then limit -= Delay between key revocation/expiry in seconds |
| 194 | gc_state <<= 1 |
| 208 | spin_lock( & key_serial_lock) |
| 211 | continue_scanning : |
| 213 | key = rb_entry(cursor, structkey, serial_node) |
| 216 | If _read - get a refcount's value*@r: the refcount* Return: the refcount's value == 0 Then Go to found_unreferenced_key |
| 220 | If type of key == key_gc_dead_keytype Then |
| 223 | access permissions = 0 |
| 224 | Go to skip_dead_key |
| 227 | Go to found_restricted_keyring |
| 231 | If gc_state & - We need to restart the timer Then |
| 232 | If time at which key expires (or 0) > limit && time at which key expires (or 0) < new_timer Then |
| 233 | kdebug("will expire %x in %lld", key_serial(key), time at which key expires (or 0) - limit) |
| 239 | If Value for the false possibility is greater at compile time(gc_state & - We need to reap dead key links ) Then If type of key == key_gc_dead_keytype Then |
| 245 | If type of key == key_type_keyring Then Go to found_keyring |
| 249 | If Value for the false possibility is greater at compile time(gc_state & - We need to reap dead keys ) Then If type of key == key_gc_dead_keytype Then |
| 251 | Go to destroy_dead_key |
| 253 | skip_dead_key : |
| 254 | If spin_is_contended( & key_serial_lock) || need_resched() Then Go to contended |
| 258 | contended : |
| 259 | spin_unlock( & key_serial_lock) |
| 261 | maybe_resched : |
| 262 | If cursor Then |
| 272 | kdebug("pass complete") |
| 274 | If gc_state & - We need to restart the timer && new_timer != Located here for timespec[64]_valid_strict Then |
| 286 | kdebug("gc sync") |
| 291 | kdebug("gc keys") |
| 319 | Return |
| 324 | found_unreferenced_key : |
| 325 | kdebug("unrefd key %d", key serial number ) |
| 326 | rb_erase( & serial_node, & key_serial_tree) |
| 327 | spin_unlock( & key_serial_lock) |
| 331 | Go to maybe_resched |
| 336 | found_restricted_keyring : |
| 337 | spin_unlock( & key_serial_lock) |
| 339 | Go to maybe_resched |
| 346 | found_keyring : |
| 347 | spin_unlock( & key_serial_lock) |
| 348 | keyring_gc(key, limit) |
| 349 | Go to maybe_resched |
| 354 | destroy_dead_key : |
| 355 | spin_unlock( & key_serial_lock) |
| 356 | kdebug("destroy key %d", key serial number ) |
| 357 | lock for writing |
| 358 | type of key = Any key whose type gets unregistered will be re-typed to this if it can't be* immediately unlinked. |
| 361 | memset( & payload, security/ *********, size of payload ) |
| 363 | Go to maybe_resched |
| 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 |