From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1424041AbdD1Gdi (ORCPT ); Fri, 28 Apr 2017 02:33:38 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:36057 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1164100AbdD1Gd2 (ORCPT ); Fri, 28 Apr 2017 02:33:28 -0400 Date: Fri, 28 Apr 2017 08:33:23 +0200 From: Ingo Molnar To: Thomas Garnier Cc: Martin Schwidefsky , Heiko Carstens , Dave Hansen , Arnd Bergmann , David Howells , =?iso-8859-1?Q?Ren=E9?= Nyffenegger , Andrew Morton , "Paul E . McKenney" , "Eric W . Biederman" , Thomas Gleixner , Oleg Nesterov , Pavel Tikhomirov , Ingo Molnar , "H . Peter Anvin" , Andy Lutomirski , Paolo Bonzini , Kees Cook , Rik van Riel , Josh Poimboeuf , Borislav Petkov , Brian Gerst , "Kirill A . Shutemov" , Christian Borntraeger , Russell King , Will Deacon , Catalin Marinas , Mark Rutland , James Morse , linux-s390 , LKML , Linux API , the arch/x86 maintainers , linux-arm-kernel@lists.infradead.org, Kernel Hardening Subject: Re: [PATCH v8 1/4] syscalls: Verify address limit before returning to user-mode Message-ID: <20170428063323.ntnc4tk7do2dor76@gmail.com> References: <20170426183425.32158-1-thgarnie@google.com> <20170427064917.phwo6yl4v4q43fql@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Thomas Garnier wrote: > > BTW., a further simplification would be: > > > > #ifndef ADDR_LIMIT_CHECK_PRE > > # define ADDR_LIMIT_CHECK_PRE ... > > #endif > > > > This way architectures could override this generic functionality simply by > > defining the helpers. Architectures that don't do that get the generic version. > > I don't think architectures need to do that. The optimizations are > embedding the checks on their architecture-specific code to make it > faster and remove the size impact. The pre/post is fine for the rest. Indeed, only the generic code needs to turn off that code - architectures will place these callbacks elsewhere. Thanks, Ingo