函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:kexec_calculate_store_digests

函数原型:static int kexec_calculate_store_digests(struct kimage *image)

返回类型:int

参数:

类型参数名称
struct kimage *image
710  ret等于0
715  pi等于 Information for loading purgatory
717  如果非IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_ARCH_HAS_KEXEC_PURGATORY)则返回:0
720  zero_buf等于__va(page_to_pfn(ZERO_PAGE(0)) << PAGE_SHIFT determines the page size )
721  zero_buf_sz等于PAGE_SIZE
723  tfm等于crypto_alloc_shash("sha256", 0, 0)
724  如果是错误
725  ret等于错误
726  转到:out
729  desc_size等于rypto_shash_descsize() - obtain the operational state size*@tfm: cipher handle* The size of the operational state the cipher needs during operation is* returned for the hash referenced with the cipher handledesc的长度
730  desc等于分配内存并置零
731  如果非desc
732  ret等于负ENOMEM
733  转到:out_free_tfm
736  sha_region_sz等于The artificial cap on the number of segments passed to kexec_load. sizeof(structkexec_sha_region)
737  sha_regions等于vzalloc(sha_region_sz)
738  如果非sha_regions则转到:out_free_desc
741  tfm等于tfm
743  ret等于rypto_shash_init() - (re)initialize message digest*@desc: operational state handle that is already filled* The call (re-)initializes the message digest referenced by the* operational state handle. Any potentially existing state created by
744  如果ret小于0则转到:out_free_sha_regions
747  digest等于分配内存并置零
748  如果非digest
749  ret等于负ENOMEM
750  转到:out_free_sha_regions
753 i小于nr_segments循环
756  ksegment等于segment[i]
761  如果kbuf恒等于* Temporary, modifiable buffer for stripped purgatory used for * relocation. This memory can be freed post image load.则继续下一循环
764  ret等于rypto_shash_update() - add data to message digest for processing*@desc: operational state handle that is already initialized*@data: input data to be added to the message digest*@len: length of the input data
766  如果ret退出
773  nullsz等于memszbufsz
774 nullsz循环
775  bytes等于nullsz
777  如果bytes大于zero_buf_szbytes等于zero_buf_sz
780  如果ret退出
782  nullsz减等于bytes
785  如果ret退出
788  start等于mem
789  len等于memsz
790  j自加
793  如果非ret
794  ret等于rypto_shash_final() - calculate message digest*@desc: operational state handle that is already filled with data*@out: output buffer filled with the message digest* Finalize the message digest operation and create the message digest
795  如果ret则转到:out_free_digest
797  ret等于kexec_purgatory_get_set_symbol(image, "purgatory_sha_regions", sha_regions, sha_region_sz, 0)
799  如果ret则转到:out_free_digest
802  ret等于kexec_purgatory_get_set_symbol(image, "purgatory_sha256_digest", digest, SHA256_DIGEST_SIZE, 0)
804  如果ret则转到:out_free_digest
808  out_free_digest :
809  kfree(digest)
810  out_free_sha_regions :
811  vfree(sha_regions)
812  out_free_desc :
813  kfree(desc)
814  out_free_tfm :
815  kfree(tfm)
816  out :
817  返回:ret
调用者
名称描述
SYSCALL_DEFINE5