* [PATCH] ima: Report errno for failed hash collection to audit
@ 2026-07-16 19:10 Frederick Lawler
0 siblings, 0 replies; only message in thread
From: Frederick Lawler @ 2026-07-16 19:10 UTC (permalink / raw)
To: Mimi Zohar, Roberto Sassu, Dmitry Kasatkin, Eric Snowberg,
Paul Moore, James Morris, Serge E. Hallyn
Cc: linux-integrity, linux-security-module, linux-kernel, kernel-team,
Frederick Lawler
integrity_audit_msg() wraps integrity_audit_message() such that errno is
always set to zero. When debugging for failed hashes, it'd be nice to
understand the corresponding error code with the cause.
Signed-off-by: Frederick Lawler <fred@cloudflare.com>
---
security/integrity/ima/ima_api.c | 6 +++---
security/integrity/ima/ima_template_lib.c | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/security/integrity/ima/ima_api.c b/security/integrity/ima/ima_api.c
index 122d127e108dcca8ddae6575c908144859783fb6..15883e4f077e0aa950f3fdd4b573873929da68aa 100644
--- a/security/integrity/ima/ima_api.c
+++ b/security/integrity/ima/ima_api.c
@@ -328,9 +328,9 @@ int ima_collect_measurement(struct ima_iint_cache *iint, struct file *file,
take_dentry_name_snapshot(&filename, file->f_path.dentry);
- integrity_audit_msg(AUDIT_INTEGRITY_DATA, inode,
- filename.name.name, "collect_data",
- audit_cause, result, 0);
+ integrity_audit_message(AUDIT_INTEGRITY_DATA, inode,
+ filename.name.name, "collect_data",
+ audit_cause, result, 0, result);
release_dentry_name_snapshot(&filename);
}
diff --git a/security/integrity/ima/ima_template_lib.c b/security/integrity/ima/ima_template_lib.c
index 8a89236f926c10af0dd2b2ef08fbe59bd8a78b66..6d163312fb4c47ce256766e997aac5f7375088a8 100644
--- a/security/integrity/ima/ima_template_lib.c
+++ b/security/integrity/ima/ima_template_lib.c
@@ -390,9 +390,9 @@ int ima_eventdigest_init(struct ima_event_data *event_data,
ima_hash_algo : HASH_ALGO_SHA1;
result = ima_calc_file_hash(event_data->file, hash_hdr);
if (result) {
- integrity_audit_msg(AUDIT_INTEGRITY_DATA, inode,
- event_data->filename, "collect_data",
- "failed", result, 0);
+ integrity_audit_message(AUDIT_INTEGRITY_DATA, inode,
+ event_data->filename, "collect_data",
+ "failed", result, 0, result);
return result;
}
cur_digest = hash_hdr->digest;
---
base-commit: 1da739feb31b4fecae465ebf87ba44a97e44101b
change-id: 20260716-report-hash-error-5203d6fe6e4e
Best regards,
--
Frederick Lawler <fred@cloudflare.com>
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-07-16 19:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-16 19:10 [PATCH] ima: Report errno for failed hash collection to audit Frederick Lawler
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox