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 X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2AC3EC433E0 for ; Fri, 5 Feb 2021 18:41:58 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A78B464E51 for ; Fri, 5 Feb 2021 18:41:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A78B464E51 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 276F06B0070; Fri, 5 Feb 2021 13:41:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 227BA6B0071; Fri, 5 Feb 2021 13:41:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 115BC6B0073; Fri, 5 Feb 2021 13:41:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0022.hostedemail.com [216.40.44.22]) by kanga.kvack.org (Postfix) with ESMTP id EEB9A6B0070 for ; Fri, 5 Feb 2021 13:41:56 -0500 (EST) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id AE7641EF3 for ; Fri, 5 Feb 2021 18:41:56 +0000 (UTC) X-FDA: 77785083432.03.frogs11_2c12c43275e7 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin03.hostedemail.com (Postfix) with ESMTP id 8DD0028A4ED for ; Fri, 5 Feb 2021 18:41:56 +0000 (UTC) X-HE-Tag: frogs11_2c12c43275e7 X-Filterd-Recvd-Size: 4039 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by imf08.hostedemail.com (Postfix) with ESMTP for ; Fri, 5 Feb 2021 18:41:55 +0000 (UTC) IronPort-SDR: 3iZASPiqy40oZKfKZjin3prrRpXclnU64SsyWYC5at8e94DY9lYqW+CzeZBIwa9sUOC77XZchs WEk5RNNErkmQ== X-IronPort-AV: E=McAfee;i="6000,8403,9886"; a="177967337" X-IronPort-AV: E=Sophos;i="5.81,155,1610438400"; d="scan'208";a="177967337" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Feb 2021 10:41:53 -0800 IronPort-SDR: fYIBCWf6F8YGiaVwigkg6COEp/BFyCf3VF9Mir7LXUkPJtAgu5VY9t1zFYzDqvdG8dSaeFpRJW k8iP9sQMMw5g== X-IronPort-AV: E=Sophos;i="5.81,155,1610438400"; d="scan'208";a="358363786" Received: from yyu32-mobl1.amr.corp.intel.com (HELO [10.212.95.7]) ([10.212.95.7]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Feb 2021 10:41:52 -0800 Subject: Re: [PATCH v19 08/25] x86/mm: Introduce _PAGE_COW To: Dave Hansen , Kees Cook Cc: x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , Andy Lutomirski , Balbir Singh , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , "H.J. Lu" , Jann Horn , Jonathan Corbet , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue , Dave Martin , Weijiang Yang , Pengfei Xu References: <20210203225547.32221-1-yu-cheng.yu@intel.com> <20210203225547.32221-9-yu-cheng.yu@intel.com> <202102041215.B54FCA552F@keescook> <2e43bf0b-e1a9-99f6-8d5d-d6e6886b4217@intel.com> From: "Yu, Yu-cheng" Message-ID: <7381d8c1-5e1c-2667-7cb8-0a99f2c79b6d@intel.com> Date: Fri, 5 Feb 2021 10:41:52 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <2e43bf0b-e1a9-99f6-8d5d-d6e6886b4217@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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 2/4/2021 12:27 PM, Dave Hansen wrote: > On 2/4/21 12:19 PM, Kees Cook wrote: >>> (e) A page where the processor observed a Write=1 PTE, started a write, set >>> Dirty=1, but then observed a Write=0 PTE. That's possible today, but >>> will not happen on processors that support shadow stack. >> What happens for "e" with/without CET? It sounds like direct writes to >> such pages will be (correctly) rejected by the MMU? > > A page fault would be generated regardless of CET support. > > If CET were not around, the fault would be reported as a present, write > fault. > > If this happened and CET were around (which shouldn't happen in > practice, it means we have a hardware issue) a page fault exception is > generated. Thanks for the clarification. With or without CET, direct write to Write=0, Dirty=1 PTE triggers page fault. > Yu-cheng, I'm not sure there's enough debugging around to > tell us if this happens. Would we even notice? That potential hardware issue is, on a CET-capable system, a processor writes to a Write=1, Dirty=0 page, and then observes the PTE is Write=0, Dirty=1. Let me think about it... Thanks! -- Yu-cheng