Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2178199pxb; Fri, 5 Feb 2021 10:47:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJwUZW1AqVN5p+Aaxm+St/9Mn/7iYbp+2qvoj6aKEjVtPhchXanLHxFkEzmEVqtE4B+1kRji X-Received: by 2002:a17:906:5e59:: with SMTP id b25mr5291807eju.536.1612550829081; Fri, 05 Feb 2021 10:47:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612550829; cv=none; d=google.com; s=arc-20160816; b=V6C0XRuycldNdjWYZykzHKPIbAYE/UDSITBIDm242yjyxDIk7QWVoEJ+YAli3meKtb iz/+sPssKDTu4J5JiIFLSNWd64EtTVkTccTEd0Sb6EMaTUOr0tr+HPA9Wu4GHowBRfJx DviWKwT/SKx8E6OBq3YwsBqn4mWIpJDkiJi7PeBeORbc3cyTC0KCzTnek1PC38RLcUMM LdJv81/jU9hr/dwgfuBmLyoc0UZt3ghApBErm1lIlvCaiSGkrrWq3XA0IOf/O3sz/zXn yiDUA9+PGcQydamiy3RFndKupMUBOCj9ZG7MHq2ZBJ+a75r1vaCeKBDWmHTZs2iW9CCi mk4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=MkFdZjrJH+PgMj1Q+X9YCx8mNdjQoEQ0+9QUr6Rum1Y=; b=qHcVPOvy2C2j6QiKSSskT5YW4WbzTiQV/0fGLxmf7XB8bKaogtTbd7iTFn4/vFu1BC ZlmpHEvIZbNijB4bJZrkEw6ykg/4RXFGCUJp91jcUisGTpYtJxKBA3HQhNWE47FuYWbv QcnAA1orrbSTO719OcCGoZpjowKhO7MiCOcHs57hMZhMkFRT9+jBHSWv0L03Savbk5pt ZEchoccdV5Knyxeqm+wyhvrNaQxrq3CCgqqaYgoC93/dI6dcMB6JEJkkISfRFDacR6AX GQGSt1IPlU6obzupr4aDiVSEM02ygC9q62zb8J6kozu0DODnTaHvV6W6AlI1swhKUNMN 9sgA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jl7si2751821ejc.746.2021.02.05.10.46.40; Fri, 05 Feb 2021 10:47:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233789AbhBERCz (ORCPT + 99 others); Fri, 5 Feb 2021 12:02:55 -0500 Received: from mga07.intel.com ([134.134.136.100]:46168 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233614AbhBERAQ (ORCPT ); Fri, 5 Feb 2021 12:00:16 -0500 IronPort-SDR: Ke/YG5Sr9I7n8vd4favQ7vANhQYVpmv01iWW3rFZ64Ms6C3aG4z/4fBTE2HsLU+YptgajHPqr7 W+gb628L+QZA== X-IronPort-AV: E=McAfee;i="6000,8403,9886"; a="245543343" X-IronPort-AV: E=Sophos;i="5.81,155,1610438400"; d="scan'208";a="245543343" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga105.jf.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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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