From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Paris Subject: Re: [PATCH v2.1] audit: Only use the syscall slowpath when syscall audit rules exist Date: Wed, 05 Feb 2014 14:46:35 +0100 Message-ID: <1391607995.13157.24.camel@localhost> References: <377a1c5ce05e25b068cf7576d094885c1396c6bc.1391454589.git.luto@amacapital.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <377a1c5ce05e25b068cf7576d094885c1396c6bc.1391454589.git.luto@amacapital.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com To: Andy Lutomirski Cc: linux-audit@redhat.com, Andi Kleen , linux-kernel@vger.kernel.org, Oleg Nesterov List-Id: linux-audit@redhat.com On Mon, 2014-02-03 at 11:11 -0800, Andy Lutomirski wrote: > +void audit_inc_n_rules() > +{ > + struct task_struct *p, *g; > + unsigned long flags; > + > + read_lock_irqsave(&tasklist_lock, flags); > + if (audit_n_rules++ == 0) { I know it's right, but it's too clever for me :) If we do end up adding something like this Can we just do: if (!audit_n_rules) {} audit_n_rules++ I like dumb code :) > + do_each_thread(g, p) { > + if (p->audit_context) > + set_tsk_thread_flag(p, TIF_SYSCALL_AUDIT); > + } while_each_thread(g, p); > + } > + read_unlock_irqrestore(&tasklist_lock, flags); > +}