linux-audit.redhat.com archive mirror
 help / color / mirror / Atom feed
* [PATCH ghak120] audit: trigger accompanying records when no rules present
@ 2020-02-18 21:00 Richard Guy Briggs
  2020-02-18 21:00 ` Richard Guy Briggs
  2020-02-28  1:02 ` Paul Moore
  0 siblings, 2 replies; 8+ messages in thread
From: Richard Guy Briggs @ 2020-02-18 21:00 UTC (permalink / raw)
  To: Linux-Audit Mailing List, LKML
  Cc: Paul Moore, sgrubb, omosnace, eparis, Richard Guy Briggs

When there are no audit rules registered, mandatory records (config,
etc.) are missing their accompanying records (syscall, proctitle, etc.).

This is due to audit context dummy set on syscall entry based on absence
of rules that signals that no other records are to be printed.

Clear the dummy bit in auditsc_set_stamp() when the first record of an
event is generated.

Please see upstream github issue
https://github.com/linux-audit/audit-kernel/issues/120

Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
---
 kernel/auditsc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index 4effe01ebbe2..31195d122344 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -2176,6 +2176,8 @@ int auditsc_get_stamp(struct audit_context *ctx,
 	t->tv_sec  = ctx->ctime.tv_sec;
 	t->tv_nsec = ctx->ctime.tv_nsec;
 	*serial    = ctx->serial;
+	if (ctx->dummy)
+		ctx->dummy = 0;
 	if (!ctx->prio) {
 		ctx->prio = 1;
 		ctx->current_state = AUDIT_RECORD_CONTEXT;
-- 
1.8.3.1

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

end of thread, other threads:[~2020-03-10 12:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-18 21:00 [PATCH ghak120] audit: trigger accompanying records when no rules present Richard Guy Briggs
2020-02-18 21:00 ` Richard Guy Briggs
2020-02-28  1:02 ` Paul Moore
2020-02-28  1:02   ` Paul Moore
2020-03-09 20:31   ` Richard Guy Briggs
2020-03-09 23:55     ` Paul Moore
2020-03-10  0:58       ` Richard Guy Briggs
2020-03-10 12:08         ` Paul Moore

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).