Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Retrieve the status of an fscrypt master encryption key

Proto:int fscrypt_ioctl_get_key_status(struct file *filp, void __user *uarg)

Type:int

Parameter:

TypeParameterName
struct file *filp
void __user *uarg
896  sb = i_sb
902  If copy_from_user( & arg, uarg, size of arg ) Then Return -EFAULT
905  If Not valid_key_spec( & put ) Then Return -EINVAL
908  If memchr_inv - Find an unmatching character in an area of memory.*@start: The memory area*@c: Find a character other than c*@bytes: The size of the area.* returns the address of the first character other than @c, or %NULL Then Return -EINVAL
911  status_flags = 0
912  user_count = 0
913  memset(__out_reserved, 0, size of __out_reserved )
915  key = Find the specified master key in ->s_master_keys.* Returns ERR_PTR(-ENOKEY) if not found.
916  If IS_ERR(key) Then
917  If key != ERR_PTR( - ENOKEY) Then Return PTR_ERR(key)
919  status = utput
920  err = 0
921  Go to out
923  mk = data[0]
924  lock for reading
926  If 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) Then
927  status = FSCRYPT_KEY_STATUS_INCOMPLETELY_REMOVED
928  err = 0
929  Go to out_release_key
932  status = FSCRYPT_KEY_STATUS_PRESENT
933  If Keyring which contains a key of type 'key_type_fscrypt_user' for each* user who has added this key Then
936  user_count = nr_leaves_on_tree
937  mk_user = Find the current user's "key" in the master key's ->mk_users.* Returns ERR_PTR(-ENOKEY) if not found.
938  If Not IS_ERR(mk_user) Then
941  key_put(mk_user)
942  Else if mk_user != ERR_PTR( - ENOKEY) Then
943  err = PTR_ERR(mk_user)
944  Go to out_release_key
947  err = 0
948  out_release_key :
949  lease a read lock
950  key_put(key)
951  out :
952  If Not err && copy_to_user(uarg, & arg, size of arg ) Then err = -EFAULT
954  Return err