[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <672fa390-c88c-4e2a-aa42-52d171acfd62@intel.com>
Date: Mon, 7 Feb 2022 16:13:45 -0800
From: Dave Hansen <dave.hansen@...el.com>
To: Rick Edgecombe <rick.p.edgecombe@...el.com>, x86@...nel.org,
"H . Peter Anvin" <hpa@...or.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org,
linux-doc@...r.kernel.org, linux-mm@...ck.org,
linux-arch@...r.kernel.org, linux-api@...r.kernel.org,
Arnd Bergmann <arnd@...db.de>,
Andy Lutomirski <luto@...nel.org>,
Balbir Singh <bsingharora@...il.com>,
Borislav Petkov <bp@...en8.de>,
Cyrill Gorcunov <gorcunov@...il.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Eugene Syromiatnikov <esyr@...hat.com>,
Florian Weimer <fweimer@...hat.com>,
"H . J . Lu" <hjl.tools@...il.com>, Jann Horn <jannh@...gle.com>,
Jonathan Corbet <corbet@....net>,
Kees Cook <keescook@...omium.org>,
Mike Kravetz <mike.kravetz@...cle.com>,
Nadav Amit <nadav.amit@...il.com>,
Oleg Nesterov <oleg@...hat.com>, Pavel Machek <pavel@....cz>,
Peter Zijlstra <peterz@...radead.org>,
Randy Dunlap <rdunlap@...radead.org>,
"Ravi V . Shankar" <ravi.v.shankar@...el.com>,
Dave Martin <Dave.Martin@....com>,
Weijiang Yang <weijiang.yang@...el.com>,
"Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
joao.moreira@...el.com, John Allen <john.allen@....com>,
kcc@...gle.com, eranian@...gle.com
Cc: Yu-cheng Yu <yu-cheng.yu@...el.com>, Christoph Hellwig <hch@....de>
Subject: Re: [PATCH 07/35] x86/mm: Remove _PAGE_DIRTY from kernel RO pages
On 1/30/22 13:18, Rick Edgecombe wrote:
> The x86 family of processors do not directly create read-only and Dirty
> PTEs. These PTEs are created by software.
That's not strictly correct.
There's nothing in the architecture today to prevent the CPU from
creating Write=0,Dirty=1 PTEs. In fact, some CPUs do this in weird
situations. It wouldn't be wrong to say:
Processors sometimes directly create read-only and Dirty PTEs.
which is the opposite of what is written above. This is why the CET
spec has the blurb about shadow-stack-supporting CPUs promise not to do
this any more.
> One such case is that kernel
> read-only pages are historically setup as Dirty.
^ set up
> New processors that support Shadow Stack regard read-only and Dirty PTEs as
> shadow stack pages.
This also isn't *quite* correct. It's not just having a new processor,
it includes enabling shadow stacks.
> This results in ambiguity between shadow stack and kernel read-only
> pages. To resolve this, removed Dirty from kernel read- only pages.
One thing that's not clear from the spec: does this cause an *actual*
problem? For instance, does setting:
IA32_U_CET.SH_STK_EN=1
but
IA32_S_CET.SH_STK_EN=0
means that shadow stacks are enforced in user *MODE* or on
user-paging-permission (U=0) PTEs?
I think it's modes, but it would be nice to be clear. *BUT*, if this is
accurate, doesn't it also mean that this patch is not strictly necessary?
Don't get me wrong, the patch is probably still a good idea, but let's
make sure we get the exact reasoning clear.
Powered by blists - more mailing lists