函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Get the key quota record for a user, allocating a new record if one doesn't* already exist.

函数原型:struct key_user *key_user_lookup(kuid_t uid)

返回类型:struct key_user

参数:

类型参数名称
kuid_tuid
52  candidate等于NULL
55  try_again :
56  parent = NULL
57  p等于rb_node
58  加自旋锁
61 p循环
62  parent等于p
63  user等于rb_entry(parent, structkey_user, node)
65  如果uid_lt(uid, uid)则p等于rb_left
67  否则如果uid_gt(uid, uid)则p等于rb_right
69  否则转到:found
74  如果非candidate
77  自旋锁解锁
79  user = NULL
80  candidate等于开辟内存
81  如果此条件成立可能性小(为编译器优化)(!candidate)则转到:out
87  转到:try_again
92  _set - set a refcount's value*@r: the refcount*@n: value to which the refcount will be set
93  atomic_set( & umber of keys , 0)
94  atomic_set( & umber of instantiated keys , 0)
95  uid等于uid
96  umber of keys allocated to this user 等于0
97  umber of bytes allocated to this user 等于0
98  spin_lock_init( & lock)
99  mutex_init - initialize the mutex*@mutex: the mutex to be initialized* Initialize the mutex to unlocked state.* It is not allowed to initialize an already locked mutex.( & construction initiation lock )
101  rb_link_node( & node, parent, p)
102  rb_insert_color( & node, & ree of quota records indexed by UID )
103  自旋锁解锁
104  user等于candidate
105  转到:out
108  found :
109  _inc - increment a refcount*@r: the refcount to increment* Similar to atomic_inc(), but will saturate at REFCOUNT_SATURATED and WARN
110  自旋锁解锁
111  释放内存
112  out :
113  返回:user
调用者
名称描述
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.
keyctl_chown_keyChange the ownership of a key* The key must grant the caller Setattr permission for this to work, though* the key need not be fully instantiated yet. For the UID to be changed, or* for the GID to be changed to a group the caller is not a member of, the
construct_key_and_linkCommence key construction.