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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 251D4ECAAA1 for ; Thu, 27 Oct 2022 19:26:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9DA266B0071; Thu, 27 Oct 2022 15:26:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 98A1C6B0073; Thu, 27 Oct 2022 15:26:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8786E6B0074; Thu, 27 Oct 2022 15:26:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 7B6D56B0071 for ; Thu, 27 Oct 2022 15:26:45 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 52104120D80 for ; Thu, 27 Oct 2022 19:26:45 +0000 (UTC) X-FDA: 80067711570.12.7C08FEC Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) by imf13.hostedemail.com (Postfix) with ESMTP id E795320014 for ; Thu, 27 Oct 2022 19:26:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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=2DRp4MUOZX5RGg4JRQn7kAqNv3EFG3+0HRKGszsAM6A=; b=MjIU7IqdjNxtf0plLgLwdGp0Gl vHItaAHoZT8KIS1wqV8EKMv03v4I1fCvbLu6lcV6dXhWN4KjLcVBwpMtgQuaCXIJHaaKf0PhsTr5Y g11VJRiXRxP/CN450j6mzn2mgn9zdiDUcN8OU2FCA/SezJEgYf0xH/bA/BJjH+x49Vld9CCIDR1rp jgra6aOUVnaMioaHpsJwxw6OP49qBPXGGXDpKMlLr61sVTsXPRK14yLKofZRhGB1JFQh8H01OmbqK 523EuP4b+0zzk57JyLfiXcuh6G2qa9eGVDAPFOlwYJ6iGD0rV/2NOIj+ehD27O+H9CsUrbBWQG/H4 dG4qroeQ==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oo8WR-006wHJ-Tn; Thu, 27 Oct 2022 19:26:36 +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) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 3106230017F; Thu, 27 Oct 2022 21:26:35 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 1B20721204F6F; Thu, 27 Oct 2022 21:26:35 +0200 (CEST) Date: Thu, 27 Oct 2022 21:26:34 +0200 From: Peter Zijlstra To: Kees Cook Cc: Alexander Potapenko , Marco Elver , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Dave Hansen , x86@kernel.org Subject: Re: [PATCH] x86/uaccess: instrument copy_from_user_nmi() Message-ID: References: <20221025221755.3810809-1-glider@google.com> <202210271155.33956B1@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202210271155.33956B1@keescook> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666898805; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=2DRp4MUOZX5RGg4JRQn7kAqNv3EFG3+0HRKGszsAM6A=; b=l8shAB4N5tFzeh9GGw6n+iLUyA0t2be1JzLshQ59N694qzNnOJOyvV7JIwM/vwDz7bLg5E UN9C7V8irawD31YahMBkQmQsNsLXhqaCVdc6aShRzZQdOvGXssox5lUJqFuDm9chxoGkqX u7KUPSP0J/MdQSFBPMUqLNpMrt81YGo= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=desiato.20200630 header.b=MjIU7Iqd; dmarc=none; spf=none (imf13.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.92.199) smtp.mailfrom=peterz@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666898805; a=rsa-sha256; cv=none; b=gr7Ok6A50tSap6Izg4eXVZMRiRS2WzKZu0umlbkW1PenIWmlJErGl8z+kSyrbJ5AGwTDIk 3aDVQjNdC1jTnS62/VrqBooqrgK+szHs4DHORTAqlE4UTojbV8S3SlxD8N1rMlUaXnBsYz OAjnEvwLxDfer41gI/Rmci7y2CghKYU= X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: E795320014 X-Rspam-User: Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=desiato.20200630 header.b=MjIU7Iqd; dmarc=none; spf=none (imf13.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.92.199) smtp.mailfrom=peterz@infradead.org X-Stat-Signature: tau3afdmhtjbbm17ssttaaas597t8mus X-HE-Tag: 1666898802-410633 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Oct 27, 2022 at 11:58:35AM -0700, Kees Cook wrote: > I wandered around attempting to deal with in_nmi(), etc. And in > the end just drop the attempt to cover it. It's worth noting that > copy_from_user_nmi() exists on 1 architecture and has exactly 1 > call-site... Yeah, back when I wrote it, it was a lot more complicated because we could not reliably take #PF from NMI context; it did manual page-walks, kmap_atomic()s and mempcy(). That's all fixed now and it's really mostly a rudiment -- except for these instrumentation issues it seems.