public inbox for linux-audit@redhat.com
 help / color / mirror / Atom feed
From: Eric Paris <eparis@redhat.com>
To: Steve Grubb <sgrubb@redhat.com>
Cc: Linux Audit <linux-audit@redhat.com>
Subject: Re: [PATCH] Add End of Event record
Date: Thu, 27 Sep 2007 09:58:16 -0400	[thread overview]
Message-ID: <1190901496.3591.3.camel@localhost.localdomain> (raw)
In-Reply-To: <200709270916.43149.sgrubb@redhat.com>

On Thu, 2007-09-27 at 09:16 -0400, Steve Grubb wrote:
> Hi,
> 
> This patch adds an end of event record type. It will be sent by the kernel as
> the last record when a multi-record event is triggered. This will aid realtime
> analysis programs since they will now reliably know they have the last record
> to complete an event. The audit daemon filters this and will not write it to
> disk.
> 
> Signed-off-by: Steve Grubb <sgrubb@redhat.com>

Only other choice seems to be to determine up front how many records we
are going to emit, but doing that is horrible compared to this just to
save one message.  We already will usually have more than one audit
record.

Acked-by: Eric Paris <eparis@redhat.com>

> 
> 
> diff -urp linux-2.6.22.x86_64.orig/include/linux/audit.h linux-2.6.22.x86_64/include/linux/audit.h
> --- linux-2.6.22.x86_64.orig/include/linux/audit.h	2007-09-26 06:48:26.000000000 -0400
> +++ linux-2.6.22.x86_64/include/linux/audit.h	2007-09-26 06:40:25.000000000 -0400
> @@ -96,6 +96,7 @@
>  #define AUDIT_FD_PAIR		1317    /* audit record for pipe/socketpair */
>  #define AUDIT_OBJ_PID		1318	/* ptrace target */
>  #define AUDIT_TTY		1319	/* Input on an administrative TTY */
> +#define AUDIT_EOE		1320	/* End of multi-record event */
>  
>  #define AUDIT_AVC		1400	/* SE Linux avc denial or grant */
>  #define AUDIT_SELINUX_ERR	1401	/* Internal SE Linux Errors */
> diff -urp linux-2.6.22.x86_64.orig/kernel/auditsc.c linux-2.6.22.x86_64/kernel/auditsc.c
> --- linux-2.6.22.x86_64.orig/kernel/auditsc.c	2007-09-26 06:48:40.000000000 -0400
> +++ linux-2.6.22.x86_64/kernel/auditsc.c	2007-09-26 06:46:59.000000000 -0400
> @@ -1117,6 +1117,11 @@ static void audit_log_exit(struct audit_
>  
>  		audit_log_end(ab);
>  	}
> +
> +	/* Send end of event record to help user space know we are finished */
> +	ab = audit_log_start(context, GFP_KERNEL, AUDIT_EOE);
> +	if (ab)
> +		audit_log_end(ab);
>  	if (call_panic)
>  		audit_panic("error converting sid to string");
>  }

  reply	other threads:[~2007-09-27 13:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-27 13:16 [PATCH] Add End of Event record Steve Grubb
2007-09-27 13:58 ` Eric Paris [this message]
2007-09-27 16:50 ` John Dennis
2007-09-27 17:09   ` Steve Grubb
2007-09-27 17:18   ` Todd, Charles
2007-09-27 17:47     ` Steve Grubb
2007-09-27 21:39     ` Steve Grubb
2007-09-28 19:36 ` John Dennis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1190901496.3591.3.camel@localhost.localdomain \
    --to=eparis@redhat.com \
    --cc=linux-audit@redhat.com \
    --cc=sgrubb@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox