函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\integrity\ima\ima_appraise.c Create Date:2022-07-27 22:06:33
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:xattr_verify - verify xattr digest or signature* Verify whether the hash or signature matches the file contents.* Return 0 on success, error code otherwise.

函数原型:static int xattr_verify(enum ima_hooks func, struct integrity_iint_cache *iint, struct evm_ima_xattr_data *xattr_value, int xattr_len, enum integrity_status *status, const char **cause)

返回类型:int

参数:

类型参数名称
enum ima_hooksfunc
struct integrity_iint_cache *iint
struct evm_ima_xattr_data *xattr_value
intxattr_len
enum integrity_status *status
const char **cause
214  rc等于负EINVAL, hash_start等于0
217  :type恒等于IMA_XATTR_DIGEST_NG
219  hash_start等于1
221  :type恒等于IMA_XATTR_DIGEST
222  如果flags按位与IMA_DIGSIG_REQUIRED
223  cause等于"IMA-signature-required"
224  status等于INTEGRITY_FAIL
225  退出
227  lear_bit - Clears a bit in memory*@nr: Bit to clear*@addr: Address to start counting from* This is a relaxed atomic operation (no implied memory barriers).
228  如果xattr_lentype的长度减hash_start大于等于lengthrc等于内存比较
237  否则rc等于负EINVAL
239  如果rc
240  cause等于"invalid-hash"
241  status等于INTEGRITY_FAIL
242  退出
244  status等于INTEGRITY_PASS
245  退出
246  :type恒等于EVM_IMA_XATTR_DIGSIG
247  设置内存位
248  rc等于integrity_digsig_verify(INTEGRITY_KEYRING_IMA, (constchar * )xattr_value, xattr_len, digest, length)
253  如果rc恒等于负EOPNOTSUPP
255  退出
257  如果IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_INTEGRITY_PLATFORM_KEYRING)且rcfunc恒等于KEXEC_KERNEL_CHECKrc等于integrity_digsig_verify(INTEGRITY_KEYRING_PLATFORM, (constchar * )xattr_value, xattr_len, digest, length)
264  如果rc
265  cause等于"invalid-signature"
266  status等于INTEGRITY_FAIL
267  否则
268  status等于INTEGRITY_PASS
270  退出
271  默认
272  status等于INTEGRITY_UNKNOWN
273  cause等于"unknown-ima-data"
274  退出
277  返回:rc
调用者
名称描述
ima_appraise_measurementma_appraise_measurement - appraise file measurement* Call evm_verifyxattr() to verify the integrity of 'security.ima'.* Assuming success, compare the xattr hash with the collected measurement.* Return 0 on success, error code otherwise