From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934898AbbCDHJr (ORCPT ); Wed, 4 Mar 2015 02:09:47 -0500 Received: from mail-wg0-f42.google.com ([74.125.82.42]:44964 "EHLO mail-wg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933621AbbCDHJp (ORCPT ); Wed, 4 Mar 2015 02:09:45 -0500 Date: Wed, 4 Mar 2015 08:09:40 +0100 From: Ingo Molnar To: Brian Gerst Cc: the arch/x86 maintainers , Linux Kernel Mailing List , "H. Peter Anvin" , drysdale@google.com Subject: Re: [PATCH 4/5] x86: Use generic compat audit code Message-ID: <20150304070940.GB16479@gmail.com> References: <1425439896-8322-1-git-send-email-brgerst@gmail.com> <1425439896-8322-5-git-send-email-brgerst@gmail.com> <20150304051402.GC5158@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Brian Gerst wrote: > On Wed, Mar 4, 2015 at 12:14 AM, Ingo Molnar wrote: > > > > * Brian Gerst wrote: > > > >> Use the generic compat syscall audit code instead of an x86 specific > >> implementation. > >> > >> Signed-off-by: Brian Gerst > >> --- > >> arch/x86/Kconfig | 5 +-- > >> arch/x86/ia32/Makefile | 3 -- > >> arch/x86/ia32/audit.c | 43 --------------------- > >> arch/x86/include/asm/unistd32.h | 2 + > >> arch/x86/kernel/Makefile | 2 - > >> arch/x86/kernel/audit_64.c | 82 ----------------------------------------- > >> 6 files changed, 3 insertions(+), 134 deletions(-) > >> delete mode 100644 arch/x86/ia32/audit.c > >> create mode 100644 arch/x86/include/asm/unistd32.h > >> delete mode 100644 arch/x86/kernel/audit_64.c > > > > Nice! > > > > Because there are many types of conversions it would be nice if the > > changelog included a declaration of some sorts about what this means > > precisely: 'the two implementations were 100% identical', or 'the x86 > > one was buggy and we now switch to the correct generic one', or 'the > > only difference between the two is X, Y and Z, which is not a > > problem'? > > > > Thanks, > > > > Ingo > > The generic compat version was added along with the arm64 support. > It is functionally equivalent to the x86-specific implementation. > The main difference is using audit_is_compat() instead of a > hardcoded check for AUDIT_ARCH_I386. > > I just noticed a bug in lib/compat_audit.c though. It is missing > __NR_execveat. Another asymmetry is that lib/compat_audit.c covers __NR_socketcall, while arch/x86/kernel/audit.c does not. But that's an improvement I think: for __NR_socketcall the old x86 code would not do the socketcall permission check for SYS_BIND, which is an audit record generation bug AFAICS. Thanks, Ingo