函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\crypto\keyring.c Create Date:2022-07-29 10:57:20
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:add_existing_master_key

函数原型:static int add_existing_master_key(struct fscrypt_master_key *mk, struct fscrypt_master_key_secret *secret)

返回类型:int

参数:

类型参数名称
struct fscrypt_master_key *mk
struct fscrypt_master_key_secret *secret
393  如果Keyring which contains a key of type 'key_type_fscrypt_user' for each* user who has added this key
394  mk_user等于Find the current user's "key" in the master key's ->mk_users.* Returns ERR_PTR(-ENOKEY) if not found.
395  如果mk_user不等于错误号
396  如果是错误则返回:错误
398  key_put(mk_user)
399  返回:0
404  rekey等于非is_master_key_secret_present( & The secret key material. After FS_IOC_REMOVE_ENCRYPTION_KEY is* executed, this is wiped and no new inodes can be unlocked with this* key; however, there may still be inodes in ->mk_decrypted_inodes* which could not be evicted)
405  如果rekey且非_inc_not_zero - increment a refcount unless it is 0*@r: the refcount to increment* Similar to atomic_inc_not_zero(), but will saturate at REFCOUNT_SATURATED* and WARN.* Provides no memory ordering, it is assumed the caller has guaranteed the则返回:KEY_DEAD
409  如果Keyring which contains a key of type 'key_type_fscrypt_user' for each* user who has added this key
410  err等于Give the current user a "key" in ->mk_users. This charges the user's quota* and marks the master key as added by the current user, so that it cannot be* removed by another user with the key. Either the master key's key->sem must
411  如果err
414  返回:err
419  如果rekey
420  lock for writing
421  move_master_key_secret( & The secret key material. After FS_IOC_REMOVE_ENCRYPTION_KEY is* executed, this is wiped and no new inodes can be unlocked with this* key; however, there may still be inodes in ->mk_decrypted_inodes* which could not be evicted, secret)
422  lease a write lock
424  返回:0
调用者
名称描述
add_master_key