From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Date: Fri, 14 Jun 2019 11:55:20 +0000 Subject: Re: [PATCH, RFC 47/62] mm: Restrict MKTME memory encryption to anonymous VMAs Message-Id: <20190614115520.GH3436@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit List-Id: References: <20190508144422.13171-1-kirill.shutemov@linux.intel.com> <20190508144422.13171-48-kirill.shutemov@linux.intel.com> In-Reply-To: <20190508144422.13171-48-kirill.shutemov@linux.intel.com> To: "Kirill A. Shutemov" Cc: Andrew Morton , x86@kernel.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Borislav Petkov , Andy Lutomirski , David Howells , Kees Cook , Dave Hansen , Kai Huang , Jacob Pan , Alison Schofield , linux-mm@kvack.org, kvm@vger.kernel.org, keyrings@vger.kernel.org, linux-kernel@vger.kernel.org On Wed, May 08, 2019 at 05:44:07PM +0300, Kirill A. Shutemov wrote: > From: Alison Schofield > > Memory encryption is only supported for mappings that are ANONYMOUS. > Test the VMA's in an encrypt_mprotect() request to make sure they all > meet that requirement before encrypting any. > > The encrypt_mprotect syscall will return -EINVAL and will not encrypt > any VMA's if this check fails. > > Signed-off-by: Alison Schofield > Signed-off-by: Kirill A. Shutemov This should be folded back into the initial implemention, methinks.