From mboxrd@z Thu Jan 1 00:00:00 1970 Sender: Ingo Molnar Date: Fri, 28 Apr 2017 08:33:23 +0200 From: Ingo Molnar 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: Subject: [kernel-hardening] Re: [PATCH v8 1/4] syscalls: Verify address limit before returning to user-mode List-Archive: List-Post: 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 List-ID: * 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