Linux Integrity Measurement development
 help / color / mirror / Atom feed
* [PATCH v3 1/5] ima_violations.sh: force $LOG ToMToU violation earlier
@ 2025-03-05 14:54 Mimi Zohar
  2025-03-05 14:54 ` [PATCH v3 2/5] ima_violations.sh: Update validate() to support multiple violations Mimi Zohar
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Mimi Zohar @ 2025-03-05 14:54 UTC (permalink / raw)
  To: ltp; +Cc: Mimi Zohar, Stefan Berger, Petr Vorel, linux-integrity

Violation tests are dependent on searching the $LOG file, which may
itself result in a ToMToU violation.  Preempt getting an additional
violation during the tests by forcing the $LOG ToMToU violation
earlier.

Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
---
 testcases/kernel/security/integrity/ima/tests/ima_violations.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/testcases/kernel/security/integrity/ima/tests/ima_violations.sh b/testcases/kernel/security/integrity/ima/tests/ima_violations.sh
index 37d8d473c..22863fb72 100755
--- a/testcases/kernel/security/integrity/ima/tests/ima_violations.sh
+++ b/testcases/kernel/security/integrity/ima/tests/ima_violations.sh
@@ -30,6 +30,7 @@ setup()
 	if [ ! -e "$LOG" ]; then
 		tst_brk TCONF "log file not found, install auditd"
 	fi
+	exec 3< $LOG || tst_brk TBROK "failed to read log file"
 	tst_res TINFO "using log $LOG"
 }
 
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-03-06 21:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-05 14:54 [PATCH v3 1/5] ima_violations.sh: force $LOG ToMToU violation earlier Mimi Zohar
2025-03-05 14:54 ` [PATCH v3 2/5] ima_violations.sh: Update validate() to support multiple violations Mimi Zohar
2025-03-05 14:54 ` [PATCH v3 3/5] ima_violations.sh: additional open-writer violation tests Mimi Zohar
2025-03-05 14:54 ` [PATCH v3 4/5] ima_violations.sh: additional ToMToU " Mimi Zohar
2025-03-05 14:54 ` [PATCH v3 5/5] ima_violations.sh: require kernel v6.14 for minimizing violations tests Mimi Zohar
2025-03-06 17:26   ` Petr Vorel
2025-03-06 21:02     ` Mimi Zohar
2025-03-06 17:07 ` [PATCH v3 1/5] ima_violations.sh: force $LOG ToMToU violation earlier Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox