Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\crypto\keyring.c Create Date:2022-07-28 20:23:53
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:add_existing_master_key

Proto:static int add_existing_master_key(struct fscrypt_master_key *mk, struct fscrypt_master_key_secret *secret)

Type:int

Parameter:

TypeParameterName
struct fscrypt_master_key *mk
struct fscrypt_master_key_secret *secret
393  If Keyring which contains a key of type 'key_type_fscrypt_user' for each* user who has added this key Then
394  mk_user = Find the current user's "key" in the master key's ->mk_users.* Returns ERR_PTR(-ENOKEY) if not found.
395  If mk_user != ERR_PTR( - ENOKEY) Then
396  If IS_ERR(mk_user) Then Return PTR_ERR(mk_user)
398  key_put(mk_user)
399  Return 0
404  rekey = Not 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  If rekey && Not _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 Then Return KEY_DEAD
409  If Keyring which contains a key of type 'key_type_fscrypt_user' for each* user who has added this key Then
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  If err Then
414  Return err
419  If rekey Then
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  Return 0
Caller
NameDescribe
add_master_key