Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 915d9d25 authored by Thiago Jung Bauermann's avatar Thiago Jung Bauermann Committed by Mimi Zohar
Browse files

ima: Log the same audit cause whenever a file has no signature



If the file doesn't have an xattr, ima_appraise_measurement sets cause to
"missing-hash" while if there's an xattr but it's a digest instead of a
signature it sets cause to "IMA-signature-required".

Fix it by setting cause to "IMA-signature-required" in both cases.

Signed-off-by: default avatarThiago Jung Bauermann <bauerman@linux.vnet.ibm.com>
Signed-off-by: default avatarMimi Zohar <zohar@linux.vnet.ibm.com>
parent 2663218b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -217,7 +217,8 @@ int ima_appraise_measurement(enum ima_hooks func,
		if (rc && rc != -ENODATA)
			goto out;

		cause = "missing-hash";
		cause = iint->flags & IMA_DIGSIG_REQUIRED ?
				"IMA-signature-required" : "missing-hash";
		status = INTEGRITY_NOLABEL;
		if (opened & FILE_CREATED)
			iint->flags |= IMA_NEW_FILE;