From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751145AbdAQDx6 (ORCPT ); Mon, 16 Jan 2017 22:53:58 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37948 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751063AbdAQDxU (ORCPT ); Mon, 16 Jan 2017 22:53:20 -0500 Date: Mon, 16 Jan 2017 22:53:07 -0500 From: Richard Guy Briggs To: Paul Moore Cc: Eric Paris , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-audit@redhat.com, Steve@redhat.com Subject: Re: [PATCH V2] audit: log 32-bit socketcalls Message-ID: <20170117035307.GA1095@madcap2.tricolour.ca> References: <1484318543.5300.1.camel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 17 Jan 2017 03:53:12 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2017-01-16 15:04, Paul Moore wrote: > On Fri, Jan 13, 2017 at 9:42 AM, Eric Paris wrote: > > On Fri, 2017-01-13 at 04:51 -0500, Richard Guy Briggs wrote: > >> diff --git a/include/linux/audit.h b/include/linux/audit.h > >> index 9d4443f..43d8003 100644 > >> --- a/include/linux/audit.h > >> +++ b/include/linux/audit.h > >> @@ -387,6 +387,18 @@ static inline int audit_socketcall(int nargs, > >> unsigned long *args) > >> return __audit_socketcall(nargs, args); > >> return 0; > >> } > >> +static inline int audit_socketcall_compat(int nargs, u32 *args) > >> +{ > >> + if (unlikely(!audit_dummy_context())) { > > > > I've always hated these likely/unlikely. Mostly because I think they > > are so often wrong. I believe this says that you compiled audit in but > > you expect it to be explicitly disabled. While that is (recently) true > > in Fedora I highly doubt that's true on the vast majority of systems > > that have audit compiled in. > > Richard and I have talked about the likely/unlikely optimization > before and I know Richard likes to use them, but I don't for the > reasons Eric has already mentioned. Richard, since you're respinning > the patch, go ahead and yank out the unlikely() call. I don't "like to use them". I'm simply following the use and style of existing code and the arguments of others in places of critical performance. If I "fix" that one, then I would feel compelled to yank out the one in the function immediately above, audit_socketcall() for consistency to ease my conscience. Eric conceded that argument. > paul moore - RGB -- Richard Guy Briggs Kernel Security Engineering, Base Operating Systems, Red Hat Remote, Ottawa, Canada Voice: +1.647.777.2635, Internal: (81) 32635