[AUDIT] Add End of Event record

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>
Signed-off-by: Eric Paris <eparis@redhat.com>

authored by

Eric Paris and committed by
Al Viro
c0641f28 4746ec5b

+6
+1
include/linux/audit.h
··· 98 98 #define AUDIT_FD_PAIR 1317 /* audit record for pipe/socketpair */ 99 99 #define AUDIT_OBJ_PID 1318 /* ptrace target */ 100 100 #define AUDIT_TTY 1319 /* Input on an administrative TTY */ 101 + #define AUDIT_EOE 1320 /* End of multi-record event */ 101 102 102 103 #define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ 103 104 #define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */
+5
kernel/auditsc.c
··· 1270 1270 1271 1271 audit_log_end(ab); 1272 1272 } 1273 + 1274 + /* Send end of event record to help user space know we are finished */ 1275 + ab = audit_log_start(context, GFP_KERNEL, AUDIT_EOE); 1276 + if (ab) 1277 + audit_log_end(ab); 1273 1278 if (call_panic) 1274 1279 audit_panic("error converting sid to string"); 1275 1280 }