Function report |
Source Code:security\integrity\evm\evm_main.c |
Create Date:2022-07-28 19:59:57 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name: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
Proto: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)
Type:enum integrity_status
Parameter:
Type | Parameter | Name |
---|---|---|
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 | If iint && ( evm_status == INTEGRITY_PASS || evm_status == INTEGRITY_PASS_IMMUTABLE ) Then Return evm_status |
148 | rc = vfs_getxattr_alloc(dentry, XATTR_NAME_EVM, (char * * ) & xattr_data, 0, GFP_NOFS) |
150 | If rc <= 0 Then |
151 | evm_status = INTEGRITY_FAIL |
153 | rc = evm_find_protected_xattrs(dentry) |
154 | If rc > 0 Then evm_status = INTEGRITY_NOLABEL |
156 | Else if rc == 0 Then evm_status = INTEGRITY_NOXATTRS |
158 | Else if rc == -EOPNOTSUPP Then |
159 | evm_status = INTEGRITY_UNKNOWN |
161 | Go to out |
168 | Case type == EVM_XATTR_HMAC |
170 | evm_status = INTEGRITY_FAIL |
171 | Go to out |
174 | algo = HASH_ALGO_SHA1 |
175 | rc = evm_calc_hmac(dentry, xattr_name, xattr_value, xattr_value_len, & digest) |
177 | If rc Then Break |
183 | Break |
184 | Case type == EVM_IMA_XATTR_DIGSIG |
185 | Case type == EVM_XATTR_PORTABLE_DIGSIG |
186 | hdr = xattr_data |
188 | rc = evm_calc_hash(dentry, xattr_name, xattr_value, xattr_value_len, type, & digest) |
190 | If rc Then Break |
192 | rc = integrity_digsig_verify(INTEGRITY_KEYRING_EVM, (constchar * )xattr_data, xattr_len, digest, length) |
195 | If Not rc Then |
198 | If type == EVM_XATTR_PORTABLE_DIGSIG Then |
199 | If iint Then flags |= EVM_IMMUTABLE_DIGSIG |
202 | Else if Not IS_RDONLY(inode) && Not s_readonly_remount && Not IS_IMMUTABLE(inode) Then |
210 | Break |
211 | Default |
216 | If rc Then evm_status = If rc == -ENODATA Then INTEGRITY_NOXATTRS Else INTEGRITY_FAIL |
219 | out : |
220 | If iint Then evm_status = evm_status |
222 | kfree(xattr_data) |
223 | Return evm_status |
Name | Describe |
---|---|
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. |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |