[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2ec26c05-7c57-d0e0-a628-94d581b96b63@intel.com>
Date: Tue, 18 Jun 2019 07:09:36 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Peter Zijlstra <peterz@...radead.org>,
Kai Huang <kai.huang@...ux.intel.com>
Cc: Andy Lutomirski <luto@...nel.org>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Andrew Morton <akpm@...ux-foundation.org>,
X86 ML <x86@...nel.org>, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, Borislav Petkov <bp@...en8.de>,
David Howells <dhowells@...hat.com>,
Kees Cook <keescook@...omium.org>,
Jacob Pan <jacob.jun.pan@...ux.intel.com>,
Alison Schofield <alison.schofield@...el.com>,
Linux-MM <linux-mm@...ck.org>, kvm list <kvm@...r.kernel.org>,
keyrings@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>,
Tom Lendacky <thomas.lendacky@....com>
Subject: Re: [PATCH, RFC 45/62] mm: Add the encrypt_mprotect() system call for
MKTME
On 6/18/19 2:12 AM, Peter Zijlstra wrote:
> On Tue, Jun 18, 2019 at 02:23:31PM +1200, Kai Huang wrote:
>> Assuming I am understanding the context correctly, yes from this perspective it seems having
>> sys_encrypt is annoying, and having ENCRYPT_ME should be better. But Dave said "nobody is going to
>> do what you suggest in the ptr1/ptr2 example"?
>
> You have to phrase that as: 'nobody who knows what he's doing is going
> to do that', which leaves lots of people and fuzzers.
>
> Murphy states that if it is possible, someone _will_ do it. And this
> being something that causes severe data corruption on persistent
> storage,...
I actually think it's not a big deal at all to avoid the corruption that
would occur if it were allowed. But, if you're even asking to map the
same data with two different keys, you're *asking* for data corruption.
What we're doing here is continuing to preserve cache coherency and
ensuring an early failure.
We'd need two rules:
1. A page must not be faulted into a VMA if the page's page_keyid()
is not consistent with the VMA's
2. Upon changing the VMA's KeyID, all underlying PTEs must either be
checked or zapped.
If the rules are broken, we SIGBUS. Andy's suggestion has the same
basic requirements. But, with his scheme, the error can be to the
ioctl() instead of in the form of a SIGBUS. I guess that makes the
fuzzers' lives a bit easier.
BTW, note that we don't have any problems with the current anonymous
implementation and fork() because we zap at the encryption syscall.
Powered by blists - more mailing lists