Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Search the current task's subscribed keyrings for a "logon" key with* description prefix:descriptor, and if found acquire a read lock on it and* return a pointer to its validated payload in *payload_ret.

Proto:static struct key *find_and_lock_process_key(const char *prefix, const u8 descriptor[8], unsigned int min_keysize, const struct fscrypt_key **payload_ret)

Type:struct key

Parameter:

TypeParameterName
const char *prefix
const u8descriptor
unsigned intmin_keysize
const struct fscrypt_key **payload_ret
102  description = kasprintf(GFP_NOFS, "%s%*phN", prefix, FSCRYPT_KEY_DESCRIPTOR_SIZE, descriptor)
104  If Not description Then Return ERR_PTR( - ENOMEM)
107  key = quest_key - Request a key and wait for construction*@type: Type of key.*@description: The searchable description of the key.*@callout_info: The data to pass to the instantiation upcall (or NULL).
108  kfree(description)
109  If IS_ERR(key) Then Return key
112  lock for reading
113  ukp = user_key_payload_locked(key)
115  If Not ukp Then Go to invalid
118  payload = actual data
120  If length of this data != sizeof(structfscrypt_key) || size < 1 || size > FSCRYPT_MAX_KEY_SIZE Then
122  fscrypt_warn(NULL, "key with description '%s' has invalid payload", description)
125  Go to invalid
128  If size < min_keysize Then
129  fscrypt_warn(NULL, "key with description '%s' is too short (got %u bytes, need %u+ bytes)", description, size, min_keysize)
132  Go to invalid
135  payload_ret = payload
136  Return key
138  invalid :
139  lease a read lock
140  key_put(key)
141  Return ERR_PTR( - ENOKEY)
Caller
NameDescribe
fscrypt_setup_v1_file_key_via_subscribed_keyrings