From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1433918AbdDZIOs (ORCPT ); Wed, 26 Apr 2017 04:14:48 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:34124 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2994168AbdDZIMf (ORCPT ); Wed, 26 Apr 2017 04:12:35 -0400 Date: Wed, 26 Apr 2017 10:12:29 +0200 From: Ingo Molnar To: Thomas Garnier Cc: Martin Schwidefsky , Heiko Carstens , Arnd Bergmann , Dave Hansen , Andrew Morton , David Howells , =?iso-8859-1?Q?Ren=E9?= Nyffenegger , "Paul E . McKenney" , Thomas Gleixner , Oleg Nesterov , Stephen Smalley , 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 v7 1/4] syscalls: Restore address limit after a syscall Message-ID: <20170426081229.6wnugrs7w3at4xry@gmail.com> References: <20170410164420.64003-1-thgarnie@google.com> <20170425063305.hwjuxupa37rwe6zj@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: > >> +#ifdef CONFIG_ARCH_NO_SYSCALL_VERIFY_PRE_USERMODE_STATE > >> +/* > >> + * This function is called when an architecture specific implementation detected > >> + * an invalid address limit. The generic user-mode state checker will finish on > >> + * the appropriate BUG_ON. > >> + */ > >> +asmlinkage void address_limit_check_failed(void) > >> +{ > >> + verify_pre_usermode_state(); > >> + panic("address_limit_check_failed called with a valid user-mode state"); > > > > It's very unconstructive to unconditionally panic the system, just because some > > kernel code leaked the address limit! Do a warn-once printout and kill the current > > task (i.e. don't continue execution), but don't crash everything else! > > The original change did not crash the kernel for this exact reason. > Through reviews, there was an overall agreement that the kernel should > not continue in this state. Ok, I guess we can try that - but the panic message is still pretty misleading: panic("address_limit_check_failed called with a valid user-mode state"); ... so it was called with a _valid_ user-mode state, and we crash due to something valid? Huh? ( Also, the style rule applies to kernel messages as well: function names should be referred to as "function_name()". ) Thanks, Ingo