函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\keys\key.c Create Date:2022-07-27 19:50:17
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Allocate a serial number for a key. These are assigned randomly to avoid* security issues through covert channel problems.

函数原型:static inline void key_alloc_serial(struct key *key)

返回类型:void

参数:

类型参数名称
struct key *key
140  循环
141  get_random_bytes( & key serial number , key serial number 的长度)
143  key serial number 右移等于1位
144  key serial number 小于3循环
146  加自旋锁
148  attempt_insertion :
149  parent = NULL
150  p等于rb_node
152 p循环
153  parent等于p
154  xkey等于rb_entry(parent, structkey, serial_node)
156  如果 key serial number 小于 key serial number p等于rb_left
158  否则如果 key serial number 大于 key serial number p等于rb_right
160  否则转到:serial_exists
165  rb_link_node( & serial_node, parent, p)
166  rb_insert_color( & serial_node, & ree of keys indexed by serial )
168  自旋锁解锁
169  返回
173  serial_exists :
174  循环
175  key serial number 自加
176  如果 key serial number 小于3则
177  key serial number 等于3
178  转到:attempt_insertion
181  parent等于rb_next(parent)
182  如果非parent则转到:attempt_insertion
185  xkey等于rb_entry(parent, structkey, serial_node)
186  如果 key serial number 小于 key serial number 则转到:attempt_insertion
调用者
名称描述
key_allockey_alloc - Allocate a key of the specified type.*@type: The type of key to allocate.*@desc: The key description to allow the key to be searched out.*@uid: The owner of the new key.*@gid: The group ID for the new key's group permissions.