[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <14f4a09c-361c-2110-f2e8-e2465076ab5b@oracle.com>
Date: Tue, 17 Nov 2020 19:24:42 +0100
From: Alexandre Chartre <alexandre.chartre@...cle.com>
To: Borislav Petkov <bp@...en8.de>
Cc: tglx@...utronix.de, mingo@...hat.com, hpa@...or.com,
x86@...nel.org, dave.hansen@...ux.intel.com, luto@...nel.org,
peterz@...radead.org, linux-kernel@...r.kernel.org,
thomas.lendacky@....com, jroedel@...e.de, konrad.wilk@...cle.com,
jan.setjeeilers@...cle.com, junaids@...gle.com, oweisse@...gle.com,
rppt@...ux.vnet.ibm.com, graf@...zon.de, mgross@...ux.intel.com,
kuzuno@...il.com
Subject: Re: [RFC][PATCH v2 00/21] x86/pti: Defer CR3 switch to C code
On 11/17/20 6:07 PM, Borislav Petkov wrote:
> On Tue, Nov 17, 2020 at 09:19:01AM +0100, Alexandre Chartre wrote:
>> We are not reversing PTI, we are extending it.
>
> You're reversing it in the sense that you're mapping more kernel memory
> into the user page table than what is mapped now.
>
>> PTI removes all kernel mapping from the user page-table. However there's
>> no issue with mapping some kernel data into the user page-table as long as
>> these data have no sensitive information.
>
> I hope that is the case.
>
>> Actually, PTI is already doing that but with a very limited scope. PTI adds
>> into the user page-table some kernel mappings which are needed for userland
>> to enter the kernel (such as the kernel entry text, the ESPFIX, the
>> CPU_ENTRY_AREA_BASE...).
>>
>> So here, we are extending the PTI mapping so that we can execute more kernel
>> code while using the user page-table; it's a kind of PTI on steroids.
>
> And this is what bothers me - someone else might come after you and say,
> but but, I need to map more stuff into the user pgt because I wanna do
> X... and so on.
Agree, any addition should be strictly checked. I have been careful to expand
it to the minimum I needed.
>> The minimum size would be 1 page (4KB) as this is the minimum mapping size.
>> It's certainly enough for now as the usage of the PTI stack is limited, but
>> we will need larger stack if we won't to execute more kernel code with the
>> user page-table.
>
> So on a big machine with a million tasks, that's at least a million
> pages more which is what, ~4 Gb?
>
> There better be a very good justification for the additional memory
> consumption...
Yeah, adding a per-task allocation is my main concern, hence this RFC.
alex.
Powered by blists - more mailing lists