Skip to content

Commit d2ee2cf

Browse files
Huaxin Lumimizohar
authored andcommitted
ima: Fix a potential integer overflow in ima_appraise_measurement
When the ima-modsig is enabled, the rc passed to evm_verifyxattr() may be negative, which may cause the integer overflow problem. Fixes: 39b0709 ("ima: Implement support for module-style appended signatures") Signed-off-by: Huaxin Lu <luhuaxin1@huawei.com> Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
1 parent 9fab303 commit d2ee2cf

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

security/integrity/ima/ima_appraise.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,8 @@ int ima_appraise_measurement(enum ima_hooks func,
514514
goto out;
515515
}
516516

517-
status = evm_verifyxattr(dentry, XATTR_NAME_IMA, xattr_value, rc, iint);
517+
status = evm_verifyxattr(dentry, XATTR_NAME_IMA, xattr_value,
518+
rc < 0 ? 0 : rc, iint);
518519
switch (status) {
519520
case INTEGRITY_PASS:
520521
case INTEGRITY_PASS_IMMUTABLE:

0 commit comments

Comments
 (0)