提交 e75fa4da 编写于 作者: H Huaxin Lu 提交者: Zheng Zengkai

ima: Fix a potential integer overflow in ima_appraise_measurement

stable inclusion
from stable-v5.10.132
commit 831e190175f10652be93b08436cc7bf2e62e4bb6
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5YS3T

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=831e190175f10652be93b08436cc7bf2e62e4bb6

--------------------------------

[ Upstream commit d2ee2cfc ]

When the ima-modsig is enabled, the rc passed to evm_verifyxattr() may be
negative, which may cause the integer overflow problem.

Fixes: 39b07096 ("ima: Implement support for module-style appended signatures")
Signed-off-by: NHuaxin Lu <luhuaxin1@huawei.com>
Signed-off-by: NMimi Zohar <zohar@linux.ibm.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 3eaa61cb
...@@ -412,7 +412,8 @@ int ima_appraise_measurement(enum ima_hooks func, ...@@ -412,7 +412,8 @@ int ima_appraise_measurement(enum ima_hooks func,
goto out; goto out;
} }
status = evm_verifyxattr(dentry, XATTR_NAME_IMA, xattr_value, rc, iint); status = evm_verifyxattr(dentry, XATTR_NAME_IMA, xattr_value,
rc < 0 ? 0 : rc, iint);
switch (status) { switch (status) {
case INTEGRITY_PASS: case INTEGRITY_PASS:
case INTEGRITY_PASS_IMMUTABLE: case INTEGRITY_PASS_IMMUTABLE:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册