From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755561AbdEHUtz (ORCPT ); Mon, 8 May 2017 16:49:55 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:40364 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753622AbdEHUtx (ORCPT ); Mon, 8 May 2017 16:49:53 -0400 Date: Mon, 8 May 2017 21:48:58 +0100 From: Al Viro To: Jann Horn Cc: Ingo Molnar , Kees Cook , 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: <20170508204858.GT29622@ZenIV.linux.org.uk> References: <20170428153213.137279-1-thgarnie@google.com> <20170508073352.caqe3fqf7nuxypgi@gmail.com> <20170508140230.23kxf2kfeazeo4zr@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 08, 2017 at 04:06:35PM +0200, Jann Horn wrote: > I think Kees might be talking about > https://bugs.chromium.org/p/project-zero/issues/detail?id=822, fixed in > commit e6978e4bf181fb3b5f8cb6f71b4fe30fbf1b655c. The issue was that > perf code that can run in pretty much any context called access_ok(). And that commit has *NOT* solved the problem. perf_callchain_user() can be called synchronously, without passing through that code. Tracepoint shite... That set_fs() should be done in get_perf_callchain(), just around the call of perf_callchain_user(). Along with pagefault_disable(), actually. BTW, that's a nice example demonstrating why doing that on the kernel boundary is wrong. Wider (in theory) area being "protected" => easier to miss the ways not crossing its border.