From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754835AbdEHOCk (ORCPT ); Mon, 8 May 2017 10:02:40 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:36857 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754770AbdEHOCg (ORCPT ); Mon, 8 May 2017 10:02:36 -0400 Date: Mon, 8 May 2017 16:02:30 +0200 From: Ingo Molnar To: Kees Cook Cc: Thomas Garnier , Martin Schwidefsky , Heiko Carstens , Dave Hansen , Arnd Bergmann , Thomas Gleixner , David Howells , =?iso-8859-1?Q?Ren=E9?= Nyffenegger , Andrew Morton , "Paul E . McKenney" , "Eric W . Biederman" , Oleg Nesterov , Pavel Tikhomirov , Ingo Molnar , "H . Peter Anvin" , Andy Lutomirski , Paolo Bonzini , 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 , Linus Torvalds , Peter Zijlstra Subject: Re: [PATCH v9 1/4] syscalls: Verify address limit before returning to user-mode Message-ID: <20170508140230.23kxf2kfeazeo4zr@gmail.com> References: <20170428153213.137279-1-thgarnie@google.com> <20170508073352.caqe3fqf7nuxypgi@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 * Kees Cook wrote: > > And yes, I realize that there were other such bugs and that such bugs might > > occur in the future - but why not push the overhead of the security check to > > the kernel build phase? I.e. I'm wondering how well we could do static > > analysis during kernel build - would a limited mode of Sparse be good enough > > for that? Or we could add a new static checker to tools/, built from first > > principles and used primarily for extended syntactical checking. > > Static analysis is just not going to cover all cases. We've had vulnerabilities > where interrupt handlers left KERNEL_DS set, for example. [...] Got any commit ID of that bug - was it because a function executed by the interrupt handler leaked KERNEL_DS? > [...] If there are performance concerns, let's put this behind a CONFIG. 2-5 > instructions is not an issue for most people that want this coverage. That doesn't really _solve_ the performance concerns, it just forces most people to enable it by creating a 'security or performance' false dichotomy ... > [...] and it still won't catch everything. Bug-finding is different from making > a bug class just unexploitable at all. As we've done before, it's the difference > between trying to find format string attacks vs just removing %n from the format > parser. No, it does not make it unexploitable, it could still be exploitable if the runtime check is buggy or if there's kernel execution outside of the regular system call paths - there's plenty of such hardware functionality on x86 for example. Thanks, Ingo