From: Amy Griffis Subject: [PATCH] sanity check audit_buffer Date: Thu, 7 Sep 2006 17:03:02 -0400 Message-ID: <20060907210302.GB12003@fc.hp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Return-path: Received: from mx1.redhat.com (mx1.redhat.com [172.16.48.31]) by int-mx1.corp.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k87L8dd4028721 for ; Thu, 7 Sep 2006 17:08:39 -0400 Received: from atlrel9.hp.com (atlrel9.hp.com [156.153.255.214]) by mx1.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k87L8c4c001581 for ; Thu, 7 Sep 2006 17:08:38 -0400 Received: from smtp1.fc.hp.com (smtp.fc.hp.com [15.15.136.127]) by atlrel9.hp.com (Postfix) with ESMTP id 33B2E3402F for ; Thu, 7 Sep 2006 17:08:28 -0400 (EDT) Received: from ldl.fc.hp.com (ldl.fc.hp.com [15.11.146.30]) by smtp1.fc.hp.com (Postfix) with ESMTP id 09F0C7A10F for ; Thu, 7 Sep 2006 21:08:28 +0000 (UTC) Received: from localhost (ldl.lart [127.0.0.1]) by ldl.fc.hp.com (Postfix) with ESMTP id CB7E213415B for ; Thu, 7 Sep 2006 15:08:27 -0600 (MDT) Received: from ldl.fc.hp.com ([127.0.0.1]) by localhost (ldl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 06158-08 for ; Thu, 7 Sep 2006 15:08:24 -0600 (MDT) Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com To: linux-audit@redhat.com List-Id: linux-audit@redhat.com Add sanity checks for NULL audit_buffer consistent with other audit_log* routines. Signed-off-by: Amy Griffis --- 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);