Skip to content

Commit

Permalink
ima: Log the same audit cause whenever a file has no signature
Browse files Browse the repository at this point in the history
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: Thiago Jung Bauermann <[email protected]>
Signed-off-by: Mimi Zohar <[email protected]>
  • Loading branch information
bauermann authored and Mimi Zohar committed Jun 21, 2017
1 parent 2663218 commit 915d9d2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion security/integrity/ima/ima_appraise.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 915d9d2

Please sign in to comment.