From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [PATCH 1/1] audit: fix oops removing watch if audit disabled Date: Sat, 23 Jun 2007 09:51:53 -0700 Message-ID: <20070623095153.279c1194.akpm@linux-foundation.org> References: <20070620223820.GA16416@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.redhat.com (mx2.redhat.com [10.255.15.25]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l5NGqWSY003517 for ; Sat, 23 Jun 2007 12:52:32 -0400 Received: from smtp2.linux-foundation.org (smtp2.linux-foundation.org [207.189.120.14]) by mx2.redhat.com (8.13.1/8.13.1) with ESMTP id l5NGqVF7021178 for ; Sat, 23 Jun 2007 12:52:31 -0400 In-Reply-To: <20070620223820.GA16416@suse.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com To: Tony Jones Cc: linux-audit@redhat.com, linux-kernel@vger.kernel.org, Al Viro List-Id: linux-audit@redhat.com > On Wed, 20 Jun 2007 15:38:20 -0700 Tony Jones wrote: > Removing a watched file will oops if audit is disabled (auditctl -e 0). > > To reproduce: > - auditctl -e 1 > - touch /tmp/foo > - auditctl -w /tmp/foo > - auditctl -e 0 > - rm /tmp/foo (or mv) > > Signed-off-by: Tony Jones > --- > > diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c > index 74cc0fc..ce61f42 100644 > --- a/kernel/auditfilter.c > +++ b/kernel/auditfilter.c > @@ -947,7 +947,7 @@ static void audit_update_watch(struct au > > /* If the update involves invalidating rules, do the inode-based > * filtering now, so we don't omit records. */ > - if (invalidating && > + if (invalidating && current->audit_context && > audit_filter_inodes(current, current->audit_context) == AUDIT_RECORD_CONTEXT) > audit_set_auditable(current->audit_context); This looks like 2.6.22 material to me. Question is: is it also 2.6.21.x material?