public inbox for linux-audit@redhat.com
 help / color / mirror / Atom feed
* [PATCH] drop EOE records from printk
@ 2008-02-21 21:59 Steve Grubb
  0 siblings, 0 replies; only message in thread
From: Steve Grubb @ 2008-02-21 21:59 UTC (permalink / raw)
  To: linux-audit

Hi,

While we are looking at the printk issue, I see that its printk'ing the EOE
(end of event) records which is really not something that we need in syslog.
Its really intended for the realtime audit event stream handled by the audit
daemon. So, lets avoid printk'ing that record type.

Signed-off-by: Steve Grubb <sgrubb@redhat.com>


diff -urp linux-2.6.24.x86_64.orig/kernel/audit.c linux-2.6.24.x86_64/kernel/audit.c
--- linux-2.6.24.x86_64.orig/kernel/audit.c	2008-02-21 16:44:01.000000000 -0500
+++ linux-2.6.24.x86_64/kernel/audit.c	2008-02-21 16:52:28.000000000 -0500
@@ -1350,17 +1350,19 @@ void audit_log_end(struct audit_buffer *
 	if (!audit_rate_check()) {
 		audit_log_lost("rate limit exceeded");
 	} else {
+		struct nlmsghdr *nlh = nlmsg_hdr(ab->skb);
 		if (audit_pid) {
-			struct nlmsghdr *nlh = nlmsg_hdr(ab->skb);
 			nlh->nlmsg_len = ab->skb->len - NLMSG_SPACE(0);
 			skb_queue_tail(&audit_skb_queue, ab->skb);
 			ab->skb = NULL;
 			wake_up_interruptible(&kauditd_wait);
-		} else if (printk_ratelimit()) {
-			struct nlmsghdr *nlh = nlmsg_hdr(ab->skb);
-			printk(KERN_NOTICE "type=%d %s\n", nlh->nlmsg_type, ab->skb->data + NLMSG_SPACE(0));
-		} else {
-			audit_log_lost("printk limit exceeded\n");
+		} else if (nlh->nlmsg_type != AUDIT_EOE) { 
+			if (printk_ratelimit()) {
+				printk(KERN_NOTICE "type=%d %s\n",
+					nlh->nlmsg_type,
+					ab->skb->data + NLMSG_SPACE(0));
+			} else 
+				audit_log_lost("printk limit exceeded\n");
 		}
 	}
 	audit_buffer_free(ab);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-02-21 21:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-21 21:59 [PATCH] drop EOE records from printk Steve Grubb

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