Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:scrypt_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

Proto:const char *fscrypt_get_symlink(struct inode *inode, const void *caddr, unsigned int max_size, struct delayed_call *done)

Type:char

Parameter:

TypeParameterName
struct inode *inode
const void *caddr
unsigned intmax_size
struct delayed_call *done
243  If WARN_ON(!IS_ENCRYPTED(inode)) Then Return ERR_PTR( - EINVAL)
247  name = READ_ONCE(i_link)
248  If name Then Return name
255  err = fscrypt_get_encryption_info(inode)
256  If err Then Return ERR_PTR(err)
258  has_key = fscrypt_has_encryption_key(inode)
265  If max_size < size of sd Then Return ERR_PTR( - EUCLEAN)
267  sd = caddr
268  name = encrypted_path
269  len = le16_to_cpu(len)
271  If len == 0 Then Return ERR_PTR( - EUCLEAN)
274  If len + size of sd - 1 > max_size Then Return ERR_PTR( - EUCLEAN)
277  err = scrypt_fname_alloc_buffer - allocate a buffer for presented filenames* Allocate a buffer that is large enough to hold any decrypted or encoded* filename (null-terminated), for the given maximum encrypted filename length
278  If err Then Return ERR_PTR(err)
281  err = scrypt_fname_disk_to_usr() - converts a filename from disk space to user* space* The caller must have allocated sufficient memory for the @oname string.* If the key is available, we'll decrypt the disk name; otherwise, we'll encode* it for presentation
282  If err Then Go to err_kfree
285  err = -EUCLEAN
286  If name[0] == '\0' Then Go to err_kfree
289  name[len] = '\0'
297  If (!has_key || cmpxchg_release( & i_link, NULL, name) != NULL) Then I really wish we had closures with sane typechecking...
301  Return name
303  err_kfree :
304  kfree(name)
305  Return ERR_PTR(err)