From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB38DC433EF for ; Thu, 14 Apr 2022 16:05:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234347AbiDNQGr (ORCPT ); Thu, 14 Apr 2022 12:06:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349701AbiDNP5A (ORCPT ); Thu, 14 Apr 2022 11:57:00 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3AA12197; Thu, 14 Apr 2022 08:38:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=kH6ujGoL9etk6d7SqVYOo2pyqaz/8ZlPBQf0CoqEg68=; b=Oh6jCARzLKsg4PYNtSSV5THm2O ldBW0UrCujjnxpsSKs0Y0+Gbtj6k3fyeYqaDCunqgh3pAF22qDYLd27vm03t7eIkC8oVwBUNq0cV4 Ald/PULQLxQGzviKQsVL3bPa9ufarOurPeYUj2vuTH6zRIMe352e2hycGGGmjj+MqTVSEb6otgYjt MekoMBu1AHHSrhdoMu4blI7h5csyF1pb2J0lmrQjs8/YDbWcoQBFKQx+WtVEY7VDz1mzAui2Ly3Ey bnt3LQkbTAwtYfR2A9Jc2VU+tkfHBw6yPbYMXxPU8YnauiiJTiVFqzgzEmejSx6QYdw3IPMbz1v7n 8TspuD2Q==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nf1Xp-00FFwW-A8; Thu, 14 Apr 2022 15:38:05 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 0DA0F30027B; Thu, 14 Apr 2022 17:38:02 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id DBEA631B90AC3; Thu, 14 Apr 2022 17:38:01 +0200 (CEST) Date: Thu, 14 Apr 2022 17:38:01 +0200 From: Peter Zijlstra To: Alexander Potapenko Cc: Alexander Viro , Andrew Morton , Andrey Konovalov , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Christoph Hellwig , Christoph Lameter , David Rientjes , Dmitry Vyukov , Eric Dumazet , Greg Kroah-Hartman , Herbert Xu , Ilya Leoshkevich , Ingo Molnar , Jens Axboe , Joonsoo Kim , Kees Cook , Marco Elver , Mark Rutland , Matthew Wilcox , "Michael S. Tsirkin" , Pekka Enberg , Petr Mladek , Steven Rostedt , Thomas Gleixner , Vasily Gorbik , Vegard Nossum , Vlastimil Babka , Linux Memory Management List , Linux-Arch , LKML Subject: Re: [PATCH v2 38/48] objtool: kmsan: list KMSAN API functions as uaccess-safe Message-ID: References: <20220329124017.737571-1-glider@google.com> <20220329124017.737571-39-glider@google.com> <20220330084615.GH8939@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 14, 2022 at 05:30:34PM +0200, Alexander Potapenko wrote: > On Wed, Mar 30, 2022 at 10:46 AM Peter Zijlstra > wrote: > > > On Tue, Mar 29, 2022 at 02:40:07PM +0200, Alexander Potapenko wrote: > > > KMSAN inserts API function calls in a lot of places (function entries > > > and exits, local variables, memory accesses), so they may get called > > > from the uaccess regions as well. > > > > That's insufficient. Explain how you did the right thing and made these > > functions actually safe to be called in this context. > > > As a result, none of KMSAN API functions perform userspace accesses, but > since they might be called from UACCESS regions they > use user_access_save/restore(). ^ That.. very good. Thanks!