Skip to content

Commit af6e006

Browse files
author
CKI Backport Bot
committed
ima: Fix a potential integer overflow in ima_appraise_measurement
JIRA: https://issues.redhat.com/browse/RHEL-80802 CVE: CVE-2022-49643 commit d2ee2cf Author: Huaxin Lu <luhuaxin1@huawei.com> Date: Tue Jul 5 13:14:17 2022 +0800 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> Signed-off-by: CKI Backport Bot <cki-ci-bot+cki-gitlab-backport-bot@redhat.com>
1 parent 5150d3a commit af6e006

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

security/integrity/ima/ima_appraise.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,8 @@ int ima_appraise_measurement(enum ima_hooks func,
408408
goto out;
409409
}
410410

411-
status = evm_verifyxattr(dentry, XATTR_NAME_IMA, xattr_value, rc, iint);
411+
status = evm_verifyxattr(dentry, XATTR_NAME_IMA, xattr_value,
412+
rc < 0 ? 0 : rc, iint);
412413
switch (status) {
413414
case INTEGRITY_PASS:
414415
case INTEGRITY_PASS_IMMUTABLE:

0 commit comments

Comments
 (0)