函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:fscrypt_get_encryption_info

函数原型:int fscrypt_get_encryption_info(struct inode *inode)

返回类型:int

参数:

类型参数名称
struct inode *inode
362  struct key * master_key = NULL
365  如果fscrypt_has_encryption_key(inode)则返回:0
368  res等于scrypt_initialize() - allocate major buffers for fs encryption
369  如果res则返回:res
372  res等于get_context(inode, & ctx, ctx的长度)
373  如果res小于0则
376  fscrypt_warn(inode, "Error %d getting encryption context", res)
379  返回:res
382  memset( & ctx, 0, ctx的长度)
383  version等于FSCRYPT_CONTEXT_V1
384  contents_encryption_mode等于Encryption algorithms
385  filenames_encryption_mode等于FSCRYPT_MODE_AES_256_CTS
386  memset(master_key_descriptor, 0x42, FSCRYPT_KEY_DESCRIPTOR_SIZE)
388  res等于v1的长度
391  crypt_info等于Shortcuts
392  如果非crypt_info则返回:负ENOMEM
395  Back-pointer to the inode 等于inode
397  res等于scrypt_policy_from_context - convert an fscrypt_context to an fscrypt_policy* Given an fscrypt_context, build the corresponding fscrypt_policy.* Return: 0 on success, or -EINVAL if the fscrypt_context has an unrecognized* version number or size.
398  如果res
399  fscrypt_warn(inode, "Unrecognized or corrupt encryption context")
401  转到:out
408  退出
412  退出
413  默认
414  WARN_ON(1)
415  res等于负EINVAL
416  转到:out
420  res等于负EINVAL
421  转到:out
424  mode等于select_encryption_mode( & The encryption policy used by this inode , inode)
425  如果是错误
426  res等于错误
427  转到:out
429  WARN_ON(ivsize > FSCRYPT_MAX_IV_SIZE)
430  Encryption mode used for this inode. It corresponds to either the* contents or filenames encryption mode, depending on the inode type.等于mode
432  res等于Find the master key, then set up the inode's actual encryption key.* If the master key is found in the filesystem-level keyring, then the* corresponding 'struct key' is returned in *master_key_ret with* ->mk_secret_sem read-locked
433  如果res则转到:out
436  如果(cmpxchg_release( & i_crypt_info, NULL, crypt_info) == NULL)则
437  如果master_key
448  crypt_info = NULL
450  res等于0
451  out :
452  如果master_key
453  mk等于data[0]
458  如果res恒等于负ENOKEYres等于0
460  put_crypt_info(crypt_info)
461  返回:res
调用者
名称描述
fscrypt_setup_filenamescrypt_setup_filename() - prepare to search a possibly encrypted directory*@dir: the directory that will be searched*@iname: the user-provided filename being searched for*@lookup: 1 if we're allowed to proceed without the key because it's* ->lookup() or
__fscrypt_prepare_symlink
fscrypt_get_symlinkscrypt_get_symlink - get the target of an encrypted symlink*@inode: the symlink inode*@caddr: the on-disk contents of the symlink*@max_size: size of @caddr buffer*@done: if successful, will be set up to free the returned target if needed
fscrypt_has_permitted_contextscrypt_has_permitted_context() - is a file's encryption policy permitted* within its directory?*@parent: inode for parent directory*@child: inode for file being looked up, opened, or linked into @parent* Filesystems must call this before permitting access
fscrypt_inherit_contextscrypt_inherit_context() - Sets a child context from its parent*@parent: Parent inode from which the context is inherited
fscrypt_require_keyscrypt_require_key - require an inode's encryption key*@inode: the inode we need the key for* If the inode is encrypted, set up its encryption key if not already done
fscrypt_d_revalidateValidate dentries in encrypted directories to make sure we aren't potentially* caching stale dentries after a key has been added.