[PATCH] sanity check audit_buffer

Amy Griffis amy.griffis at hp.com
Thu Sep 7 21:03:02 UTC 2006


Add sanity checks for NULL audit_buffer consistent with other
audit_log* routines.

Signed-off-by: Amy Griffis <amy.griffis at hp.com>
---
diff --git a/kernel/audit.c b/kernel/audit.c
index 0a36091..963fd15 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -1028,6 +1028,9 @@ void audit_log_hex(struct audit_buffer *
 	struct sk_buff *skb;
 	static const unsigned char *hex = "0123456789ABCDEF";
 
+	if (!ab)
+		return;
+
 	BUG_ON(!ab->skb);
 	skb = ab->skb;
 	avail = skb_tailroom(skb);
@@ -1060,6 +1063,9 @@ static void audit_log_n_string(struct au
 	unsigned char *ptr;
 	struct sk_buff *skb;
 
+	if (!ab)
+		return;
+
 	BUG_ON(!ab->skb);
 	skb = ab->skb;
 	avail = skb_tailroom(skb);




More information about the Linux-audit mailing list