ima: Fix a potential integer overflow in ima_appraise_measurement
authorHuaxin Lu <luhuaxin1@huawei.com>
Tue, 5 Jul 2022 05:14:17 +0000 (13:14 +0800)
committerMimi Zohar <zohar@linux.ibm.com>
Thu, 7 Jul 2022 15:50:25 +0000 (11:50 -0400)
commitd2ee2cfc4aa85ff6a2a3b198a3a524ec54e3d999
treead8e9b56f6e5c2ee0eb161ecf29deaf1454e340c
parent9fab303a2cb3d323ca3a32a8b4ab60b451141901
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: 39b07096364a ("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>
security/integrity/ima/ima_appraise.c