From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Paris Subject: Re: [PATCH v2 1/1] audit_alloc: clear TIF_SYSCALL_AUDIT if !audit_context Date: Fri, 20 Sep 2013 12:08:02 -0400 Message-ID: <1379693282.5434.10.camel@flatline.rdu.redhat.com> References: <20130915171038.GA15410@redhat.com> <20130915171109.GA15418@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20130915171109.GA15418@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com To: Oleg Nesterov Cc: Richard Guy Briggs , Zach Levis , linux-kernel@vger.kernel.org, linux-audit@redhat.com, Andrew Morton List-Id: linux-audit@redhat.com On Sun, 2013-09-15 at 19:11 +0200, Oleg Nesterov wrote: > If audit_filter_task() nacks the new thread it makes sense > to clear TIF_SYSCALL_AUDIT which can be copied from parent > by dup_task_struct(). > > A wrong TIF_SYSCALL_AUDIT is not really bad but it triggers > the "slow" audit paths in entry.S to ensure the task can not > miss audit_syscall_*() calls, this is pointless if the task > has no ->audit_context. > > Signed-off-by: Oleg Nesterov > Acked-by: Steve Grubb Acked-by: Eric Paris Richard, please pick this up into your tree. > --- > kernel/auditsc.c | 4 +++- > 1 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/kernel/auditsc.c b/kernel/auditsc.c > index 9845cb3..95293ab 100644 > --- a/kernel/auditsc.c > +++ b/kernel/auditsc.c > @@ -943,8 +943,10 @@ int audit_alloc(struct task_struct *tsk) > return 0; /* Return if not auditing. */ > > state = audit_filter_task(tsk, &key); > - if (state == AUDIT_DISABLED) > + if (state == AUDIT_DISABLED) { > + clear_tsk_thread_flag(tsk, TIF_SYSCALL_AUDIT); > return 0; > + } > > if (!(context = audit_alloc_context(state))) { > kfree(key);