函数逻辑报告 |
Source Code:security\integrity\evm\evm_main.c |
Create Date:2022-07-27 22:08:16 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| 首页 | 函数Tree |
| 注解内核,赢得工具 | 下载SCCT | English |
函数名称:vm_verify_hmac - calculate and compare the HMAC with the EVM xattr* Compute the HMAC on the dentry's protected set of extended attributes* and compare it against the stored security
函数原型:static enum integrity_status evm_verify_hmac(struct dentry *dentry, const char *xattr_name, char *xattr_value, size_t xattr_value_len, struct integrity_iint_cache *iint)
返回类型:enum integrity_status
参数:
| 类型 | 参数 | 名称 |
|---|---|---|
| struct dentry * | dentry | |
| const char * | xattr_name | |
| char * | xattr_value | |
| size_t | xattr_value_len | |
| struct integrity_iint_cache * | iint |
| 134 | struct evm_ima_xattr_data * xattr_data = NULL |
| 136 | evm_status等于INTEGRITY_PASS |
| 141 | 如果iint且evm_status恒等于INTEGRITY_PASS或evm_status恒等于INTEGRITY_PASS_IMMUTABLE的值则返回:evm_status |
| 148 | rc等于vfs_getxattr_alloc(dentry, XATTR_NAME_EVM, (char * * ) & xattr_data, 0, GFP_NOFS) |
| 150 | 如果rc小于等于0则 |
| 151 | evm_status等于INTEGRITY_FAIL |
| 154 | 如果rc大于0则evm_status等于INTEGRITY_NOLABEL |
| 156 | 否则如果rc恒等于0则evm_status等于INTEGRITY_NOXATTRS |
| 158 | 否则如果rc恒等于负EOPNOTSUPP则 |
| 161 | 转到:out |
| 168 | 当:type恒等于EVM_XATTR_HMAC |
| 170 | evm_status等于INTEGRITY_FAIL |
| 171 | 转到:out |
| 174 | algo等于HASH_ALGO_SHA1 |
| 175 | rc等于evm_calc_hmac(dentry, xattr_name, xattr_value, xattr_value_len, & digest) |
| 183 | 退出 |
| 184 | 当:type恒等于EVM_IMA_XATTR_DIGSIG |
| 185 | 当:type恒等于EVM_XATTR_PORTABLE_DIGSIG |
| 186 | hdr等于xattr_data |
| 188 | rc等于evm_calc_hash(dentry, xattr_name, xattr_value, xattr_value_len, type, & digest) |
| 192 | rc等于integrity_digsig_verify(INTEGRITY_KEYRING_EVM, (constchar * )xattr_data, xattr_len, digest, length) |
| 195 | 如果非rc则 |
| 198 | 如果type恒等于EVM_XATTR_PORTABLE_DIGSIG则 |
| 199 | 如果iint则flags或等于EVM_IMMUTABLE_DIGSIG |
| 202 | 否则如果非IS_RDONLY(inode)且非s_readonly_remount且非IS_IMMUTABLE(inode)则 |
| 210 | 退出 |
| 211 | 默认 |
| 216 | 如果rc则evm_status等于如果rc恒等于负ENODATA则INTEGRITY_NOXATTRS否则INTEGRITY_FAIL |
| 219 | out : |
| 220 | 如果iint则evm_status等于evm_status |
| 222 | 释放内存 |
| 223 | 返回:evm_status |
| 名称 | 描述 |
|---|---|
| evm_verifyxattr | vm_verifyxattr - verify the integrity of the requested xattr*@dentry: object of the verify xattr*@xattr_name: requested xattr*@xattr_value: requested xattr value*@xattr_value_len: requested xattr value length* Calculate the HMAC for the given dentry and |
| evm_verify_current_integrity | vm_verify_current_integrity - verify the dentry's metadata integrity*@dentry: pointer to the affected dentry* Verify and return the dentry's metadata integrity. The exceptions are* before EVM is initialized or in 'fix' mode. |
| 源代码转换工具 开放的插件接口 | X |
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |