From mboxrd@z Thu Jan 1 00:00:00 1970 From: Amy Griffis Subject: [PATCH] initialize name osid in audit_getname() Date: Tue, 23 Jan 2007 19:02:00 -0500 Message-ID: <20070124000200.GA21994@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.13.1/8.13.1) with ESMTP id l0O02FBH009297 for ; Tue, 23 Jan 2007 19:02:15 -0500 Received: from atlrel8.hp.com (atlrel8.hp.com [156.153.255.206]) by mx1.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id l0O02EZQ008794 for ; Tue, 23 Jan 2007 19:02:14 -0500 Received: from smtp1.fc.hp.com (smtp.fc.hp.com [15.15.136.127]) by atlrel8.hp.com (Postfix) with ESMTP id CDE1636C34 for ; Tue, 23 Jan 2007 19:02:15 -0500 (EST) Received: from ldl.fc.hp.com (ldl.fc.hp.com [15.11.146.30]) by smtp1.fc.hp.com (Postfix) with ESMTP id BB12E12E7E3 for ; Wed, 24 Jan 2007 00:02:08 +0000 (UTC) Received: from localhost (ldl.lart [127.0.0.1]) by ldl.fc.hp.com (Postfix) with ESMTP id BF3A61344C5 for ; Tue, 23 Jan 2007 17:02:07 -0700 (MST) Received: from ldl.fc.hp.com ([127.0.0.1]) by localhost (ldl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 25402-03 for ; Tue, 23 Jan 2007 17:02:03 -0700 (MST) 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 Audit contexts can be reused, so initialize a name's osid to the default in audit_getname(). This ensures we don't log a bogus object label when no inode data is collected for a name. Untested patch against lspp.63 kernel. Signed-off-by: Amy Griffis --- diff -Nrup linux-2.6.18.x86_64/kernel/auditsc.c linux-2.6.18.x86_64-amg/kernel/auditsc.c --- linux-2.6.18.x86_64/kernel/auditsc.c 2007-01-23 17:17:07.000000000 -0500 +++ linux-2.6.18.x86_64-amg/kernel/auditsc.c 2007-01-23 17:20:35.000000000 -0500 @@ -1215,6 +1215,7 @@ void __audit_getname(const char *name) context->names[context->name_count].name_len = AUDIT_NAME_FULL; context->names[context->name_count].name_put = 1; context->names[context->name_count].ino = (unsigned long)-1; + context->names[context->name_count].osid = 0; ++context->name_count; if (!context->pwd) { read_lock(¤t->fs->lock);