ima: fix error handling logic when file measurement failed
authorMatt Bobrowski <mattbobrowski@google.com>
Wed, 4 Jan 2023 03:41:44 +0000 (03:41 +0000)
committerMimi Zohar <zohar@linux.ibm.com>
Wed, 18 Jan 2023 18:17:00 +0000 (13:17 -0500)
commit6dc387d52eb67f45d68caa263704fa4e39ef8e76
treec78337ecff8bce07c9fe4837287db92d00f8e858
parent5dc4c995db9eb45f6373a956eb1f69460e69e6d4
ima: fix error handling logic when file measurement failed

Restore the error handling logic so that when file measurement fails,
the respective iint entry is not left with the digest data being
populated with zeroes.

Fixes: 54f03916fb89 ("ima: permit fsverity's file digests in the IMA measurement list")
Cc: stable@vger.kernel.org # 5.19
Signed-off-by: Matt Bobrowski <mattbobrowski@google.com>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
security/integrity/ima/ima_api.c
security/integrity/ima/ima_main.c