函数逻辑报告 |
Source Code:security\keys\key.c |
Create Date:2022-07-27 19:50:27 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| 首页 | 函数Tree |
| 注解内核,赢得工具 | 下载SCCT | English |
函数名称:key_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.
函数原型:struct key *key_alloc(struct key_type *type, const char *desc, kuid_t uid, kgid_t gid, const struct cred *cred, key_perm_t perm, unsigned long flags, struct key_restriction *restrict_link)
返回类型:struct key
参数:
| 类型 | 参数 | 名称 |
|---|---|---|
| struct key_type * | type | |
| const char * | desc | |
| kuid_t | uid | |
| kgid_t | gid | |
| const struct cred * | cred | |
| key_perm_t | perm | |
| unsigned long | flags | |
| struct key_restriction * | restrict_link |
| 238 | 如果vet_description则 |
| 250 | user等于Get the key quota record for a user, allocating a new record if one doesn't* already exist. |
| 251 | 如果非user则转到:no_memory_1 |
| 277 | 如果非key则转到:no_memory_2 |
| 281 | description等于kmemdup - duplicate region of memory*@src: memory region to duplicate*@len: memory region length*@gfp: GFP mask to use* Return: newly allocated copy of @src or %NULL in case of error |
| 282 | 如果非description则转到:no_memory_3 |
| 285 | key_set_index_key( & index_key) |
| 288 | init_rwsem( & change vs change sem ) |
| 289 | lockdep_set_class( & change vs change sem , & key->sem lock class ) |
| 290 | owner of this key 等于user |
| 295 | access permissions 等于perm |
| 299 | 如果非flags按位与 in quota 的值则 status flags (change with bitops) 或等于1左移set if key consumes quota 位 |
| 301 | 如果flags按位与Key is built into kernel 则 status flags (change with bitops) 或等于1左移set if key is built in to the kernel 位 |
| 303 | 如果flags按位与allocating a user or user session keyring 则 status flags (change with bitops) 或等于1左移set if key is a user or user session keyring 位 |
| 311 | ret等于security_key_alloc(key, cred, flags) |
| 312 | 如果ret小于0则转到:security_error |
| 317 | atomic_inc( & umber of keys ) |
| 320 | error : |
| 321 | 返回:key |
| 323 | security_error : |
| 324 | 释放内存 |
| 325 | kmem_cache_free(key_jar, key) |
| 334 | 转到:error |
| 336 | no_memory_3 : |
| 337 | kmem_cache_free(key_jar, key) |
| 338 | no_memory_2 : |
| 346 | no_memory_1 : |
| 348 | 转到:error |
| 350 | no_quota : |
| 351 | 自旋锁解锁 |
| 354 | 转到:error |
| 名称 | 描述 |
|---|---|
| key_create_or_update | key_create_or_update - Update or create and instantiate a key.*@keyring_ref: A pointer to the destination keyring with possession flag.*@type: The type of key.*@description: The searchable description for the key. |
| keyring_alloc | Allocate a keyring and link into the destination keyring. |
| construct_alloc_key | Allocate a new key in under-construction state and attempt to link it in to* the requested keyring.* May return a key that's already under construction instead if there was a* race between two thread calling request_key(). |
| request_key_auth_new | Create an authorisation token for /sbin/request-key or whoever to gain* access to the caller's security data. |
| add_new_master_key | Allocate a new fscrypt_master_key which contains the given secret, set it as* the payload of a new 'struct key' of type fscrypt, and link the 'struct key'* into the given keyring. Synchronized by fscrypt_add_key_mutex. |
| 源代码转换工具 开放的插件接口 | X |
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |