Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp348045rwi; Thu, 27 Oct 2022 02:00:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6s0b/b5C7C266UN7UebtPDWexa1MwzLgmIXf0l3G4kPdXls2crDnF9qaB4MHODc8mQxHzo X-Received: by 2002:a50:e616:0:b0:461:fc07:b630 with SMTP id y22-20020a50e616000000b00461fc07b630mr14372018edm.219.1666861215226; Thu, 27 Oct 2022 02:00:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666861215; cv=none; d=google.com; s=arc-20160816; b=Oui9KQ6c9Oh1jz6mXJrBqXFCVxomXifYjZ42E8OP0dCLtq/0y3hMCa7k/mrPuZSqr2 5EJSPxAsXqJbjGG0DnPEFE5rGXSl3IBFds9LjeaOzgEnCv81Eg/Mo7H/bKrjzeuS517Z yoYAip7j3fmFJAh27GkZCEM7NR7aukkW3oSDRmZTeXxtgnvvsuRDzPQVABk2ISHfvuon j3zEhxlEgYgrRDIOsYQ7Y0UCt8AKKMVbji3kQ5OsROPq+ChUQ+o4Pss+lnVEp4OrDffO tpbPd2NTd48DzDW7HOVO9SB6xajQbWnpjUiH0ZOknuiZh5sDgSeKtNSsDlLyWAjk7GkR aUMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+zECNnKHvQf1A6kHuAwhB50ffkPqGeMPvlWKtaCiAiE=; b=uvGAZumc3S8/pB0T3JU+q+yEHIRHePFmieOz29IhVVAxzBI9KkRko13j8kBNkXyxp6 Grq4MwBm8q8oSJAFBS14yCv+Byf6uN+V8An/12xtSHZA7Y+MBSGojbt6gpJQs9SafDo3 kzN8ZCXOXot3EMD8aMpBWA3Im1w8g/SzOMcdYa16XCJ1zpRxWU44ZznUi/yLQR7g3I8a +PoMoBrJdQvaLcKpDEeXAh+CiGYPhw/ByYTTRXBQLBqd7dDy7xLOC+5LZK3o8Hxdnv8/ 7i6oUPsMrKYrwKmnTwQ+sWG2hVoy1h8mmjfsHKyOKSmpdZEZwjnHbnoz4ire5nE2RvS7 zT3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=YPLisVZw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qk37-20020a1709077fa500b0078dfd359c52si951671ejc.602.2022.10.27.01.59.49; Thu, 27 Oct 2022 02:00:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=YPLisVZw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234288AbiJ0IG1 (ORCPT + 99 others); Thu, 27 Oct 2022 04:06:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233896AbiJ0IGH (ORCPT ); Thu, 27 Oct 2022 04:06:07 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9ED90367B7 for ; Thu, 27 Oct 2022 01:06:05 -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=+zECNnKHvQf1A6kHuAwhB50ffkPqGeMPvlWKtaCiAiE=; b=YPLisVZwst9EFxI0gcuUY+NUOK NRYAPfyNsuUDhRh2Vc9/2DiifXwycOGdA1g7mRfVdeglLv3Ck3LYNb45dW0S1PjHpT1kTmAwaFD8a dmTJcENucPuyQ4gwgGt6ALvgRQm21WR7yjhtH7REW4fASRpkZMaXAPciocqgVAnijJXl0o+eLNm6T 55UQYf15xXrcXSr6Edj2x+eutqAK3aMV8lEVqcCeZz2oQiFNJFbI6upWpMIV3+Gww+qlob+XR43j9 doFyX+Kevribl8RQt/zYE8vDgdyPbNikz7Sy7zX5ie6UFIgne6j1TtMvWhCeqB+eTPEcxQul4UC95 bOKk7gKw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1onxth-0002LC-Ff; Thu, 27 Oct 2022 08:05:53 +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 3473930029C; Thu, 27 Oct 2022 10:05:47 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 1A6DD2012B90F; Thu, 27 Oct 2022 10:05:47 +0200 (CEST) Date: Thu, 27 Oct 2022 10:05:47 +0200 From: Peter Zijlstra To: Alexander Potapenko Cc: Marco Elver , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Dave Hansen , Kees Cook , x86@kernel.org Subject: Re: [PATCH] x86/uaccess: instrument copy_from_user_nmi() Message-ID: References: <20221025221755.3810809-1-glider@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 26, 2022 at 11:38:53AM -0700, Alexander Potapenko wrote: > A bigger issue from the NMI perspective is probably > having __msan_poison_alloca() inserted in every non-noinstr kernel > function, because that hook may acquire the stackdepot lock. *urgghhh* that's broken, that must not be. There is a *TON* of NMI functions that are non-noinstr. What's worse, it seems to do a memory allocation as well, and that's out the window with PREEMPT_RT where you can't do even GFP_ATOMIC from regular IRQ context. That function is wholly unacceptable to be added to every kernel function.