函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\keys\big_key.c Create Date:2022-07-27 20:02:55
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:ad the key data* - the key's semaphore is read-locked

函数原型:long big_key_read(const struct key *key, char __user *buffer, size_t buflen)

返回类型:long

参数:

类型参数名称
const struct key *key
char __user *buffer
size_tbuflen
357  datalen等于data[big_key_len]
360  如果非bufferbuflen小于datalen则返回:datalen
363  如果datalen大于If the data is under this limit, there's no point creating a shm file to* hold it as the permanently resident metadata for the shmem fs will be at* least as large as the data.
365  struct path * path = (struct path * ) & data[big_key_path]
367  enckey等于data[big_key_data]
368  enclen等于datalenAuthentication tag length
369  pos等于0
371  buf等于Allocate a buffer consisting of a set of pages with a virtual mapping* applied over them.
372  如果非buf则返回:负ENOMEM
375  file等于dentry_open(path, O_RDONLY, current_cred - Access the current task's subjective credentials* Access the subjective credentials of the current task. RCU-safe,* since nobody else can modify it.())
376  如果是错误
377  ret等于错误
378  转到:error
382  ret等于kernel_read(file, virt, enclen, & pos)
383  如果ret大于等于0且ret不等于enclen
384  ret等于负EIO
385  转到:err_fput
388  ret等于Encrypt/decrypt big_key data
389  如果ret则转到:err_fput
392  ret等于datalen
395  如果copy_to_user(buffer, virt, datalen)不等于0则ret等于负EFAULT
398  err_fput :
399  fput(file)
400  error :
401  Free up the buffer.
402  否则
403  ret等于datalen
404  如果copy_to_user(buffer, data[big_key_data], datalen)不等于0则ret等于负EFAULT
409  返回:ret