From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by kanga.kvack.org (Postfix) with ESMTP id 7E3B58E0004 for ; Fri, 7 Dec 2018 18:49:11 -0500 (EST) Received: by mail-pg1-f198.google.com with SMTP id f125so3622718pgc.20 for ; Fri, 07 Dec 2018 15:49:11 -0800 (PST) Received: from mail.kernel.org (mail.kernel.org. [198.145.29.99]) by mx.google.com with ESMTPS id g26si4163569pfi.184.2018.12.07.15.49.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Dec 2018 15:49:10 -0800 (PST) Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B9ADB20868 for ; Fri, 7 Dec 2018 23:49:09 +0000 (UTC) Received: by mail-wr1-f44.google.com with SMTP id q18so5271314wrx.9 for ; Fri, 07 Dec 2018 15:49:09 -0800 (PST) MIME-Version: 1.0 References: <0a21eadd05b245f762f7d536d8fdf579c113a9bc.camel@intel.com> <20181207115713.ia5jbrx5e3osaqxi@kshutemo-mobl1> <19c539f8c6c9b34974e4cb4f268eb64fe7ba4297.camel@intel.com> In-Reply-To: <19c539f8c6c9b34974e4cb4f268eb64fe7ba4297.camel@intel.com> From: Andy Lutomirski Date: Fri, 7 Dec 2018 15:48:55 -0800 Message-ID: Subject: Re: [RFC v2 00/13] Multi-Key Total Memory Encryption API (MKTME) Content-Type: text/plain; charset="UTF-8" Sender: owner-linux-mm@kvack.org List-ID: To: "Sakkinen, Jarkko" Cc: "Kirill A. Shutemov" , "Kirill A. Shutemov" , Peter Zijlstra , James Morris , kai.huang@intel.com, keyrings@vger.kernel.org, Matthew Wilcox , Thomas Gleixner , Linux-MM , David Howells , LSM List , Dan Williams , X86 ML , "H. Peter Anvin" , Ingo Molnar , Andrew Lutomirski , Borislav Petkov , Dave Hansen , Alison Schofield , Jun Nakajima On Fri, Dec 7, 2018 at 3:45 PM Sakkinen, Jarkko wrote: > > On Fri, 2018-12-07 at 13:59 -0800, Jarkko Sakkinen wrote: > > On Fri, 2018-12-07 at 14:57 +0300, Kirill A. Shutemov wrote: > > > > What is the threat model anyway for AMD and Intel technologies? > > > > > > > > For me it looks like that you can read, write and even replay > > > > encrypted pages both in SME and TME. > > > > > > What replay attack are you talking about? MKTME uses AES-XTS with physical > > > address tweak. So the data is tied to the place in physical address space > > > and > > > replacing one encrypted page with another encrypted page from different > > > address will produce garbage on decryption. > > > > Just trying to understand how this works. > > > > So you use physical address like a nonce/version for the page and > > thus prevent replay? Was not aware of this. > > The brutal fact is that a physical address is an astronomical stretch > from a random value or increasing counter. Thus, it is fair to say that > MKTME provides only naive measures against replay attacks... > And this is potentially a big deal, since there are much simpler replay attacks that can compromise the system. For example, if I can replay the contents of a page table, I can write to freed memory. --Andy