Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1881071pxj; Wed, 19 May 2021 16:35:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqeopMq+0ksVpp8roxIXCq14T8cfcW0bVjGgWSjTjkhvgjbUepY1chOkRJf/4OO1FeNq3c X-Received: by 2002:a05:6402:1345:: with SMTP id y5mr1626066edw.107.1621467329521; Wed, 19 May 2021 16:35:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621467329; cv=none; d=google.com; s=arc-20160816; b=DUHgeYJ3Kj7SkONtzNo5IamA2M5/2/0MHgpBslkRzHRExrt637IWV0yTscS6stwqUd wpluGzeIu7Dm59+OkR+EI4T7Y7ZtWQfTiMbTcz2nSqVaq0L6KIB6r1LP9MsTS5fiM0rK 2NAxYRQN6i50WleBb9r0hJU7j6qT6NL3tow+F3oolUkii+/pWII5J60J/PmyyK8X3p6L XNPxxRx1tDzzDY3oJgnXpxQJH8HZr3bzTG3pbZ8QyWSQ91xx41aNstiZe3UM3uQmwjlQ 4KrHpJM5inptC2czv57OdyQz8lGzlobNBtNt8edFdLbAEYzu5xohkKRA3r2Qz6B4MH0U +m2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=0uhGbN9Jog+FC96345EUpiT1u57egVRed342Jt8fST8=; b=wNqm4nykj9fdUTLExfq8WMbjMHvNQf2dKhSOVIPsHsTq7NNQ+f9QKchZ3a3bcLi6p1 IZmCzUG4JJUZW5RDxmPLbCZ0FOTJcI1MapdviO/zCBZZEdrt+6zMK+g67ftNjyUvO4ZS MF7oPyFGX/A24YQUdOyduFenK416686+sQd6rWuhHo/+RWdrBfcCHOSrU1ffYVAa+Nng wqxaLzE3NUIrFJKkLkD+d6xAPJGZSw7SHekPw3MIf1rk4Kf8zM0akKPbDODgE2hw5sDB iy8UeHk97niax2eIhCIMXaS9SHnNn3qB2HTypPyr/F/M1XVNrDgP8cnH6s4MA2yshjM2 j7TA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=aNjrMwks; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t2si948186ejf.594.2021.05.19.16.35.01; Wed, 19 May 2021 16:35:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=aNjrMwks; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229976AbhESXgT (ORCPT + 99 others); Wed, 19 May 2021 19:36:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbhESXgS (ORCPT ); Wed, 19 May 2021 19:36:18 -0400 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A471DC061574 for ; Wed, 19 May 2021 16:34:58 -0700 (PDT) Received: by mail-pg1-x536.google.com with SMTP id 6so10554350pgk.5 for ; Wed, 19 May 2021 16:34:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=0uhGbN9Jog+FC96345EUpiT1u57egVRed342Jt8fST8=; b=aNjrMwksMJuvYFFD9/LdGMHZuoi+Hc0znhC9f+npaoSm5w3MayeaWJG6eXJvcA6NZJ uaPpvdRDWylbu1xgU/zSw3sOKjwJz8jDsZ+1eaAbRJCx2i/1ExqzE1sL0dxppSqlrxSE LuPS8udXRtus1CMFPA5nPaK0dAbDt0jCaDkxOFcr+586HowgCccny6ZvTTH7gjRAcJdh Xk6j9ptvFm8FgPQ4uQQPLJExctRKXIJb0balVMkwwwvo4VJSbsPMsio3n2L6xJ1+uPQG YxB1lCOjnvU8Ea7umWsUSpgf3PB/MJ/X6qZDdhQl+ZNN0ag/ggjyn0hVitLJFUlxWI1P emNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=0uhGbN9Jog+FC96345EUpiT1u57egVRed342Jt8fST8=; b=isPQy393IvXxD5/Ww0XlOapYTXfcdqKzJOIH58avfAqF0P+T9VTPj7PB4cXyueJFdI dWdnnZFQuGcMNiUmTFlWAbz0ksFH4Qz14Uw/tmZiXtrQmvMpQsPEJ80qJ6yLR+nJJpG7 uiGNOo1/FodPwg3y+vfPJnr3hVzxfV37MZJUXI21iddI4A2/2GQ06AJ+3wCyc3Ay/3k8 /XAg8OKZ06reK58Ni/DAAWO8loexQsvHaMpCnNmVdM/DdiDK/5mj5/miaRG2WD0uWpui 3p/WiMaIR6KeVRt6UhWWAdXz09CgrYiWVc1HQWtMuDTTmJxmLDb31dERzAE5sXuetKqy 6Xgg== X-Gm-Message-State: AOAM533NzYWn9RjJp0mfXAdd4Gg0ciCdSXcZb08nT+QSi0I53+KcxHwh aVVEKJoImH7cvGqsqhRp5Z7MMg== X-Received: by 2002:a63:6e87:: with SMTP id j129mr1610880pgc.45.1621467297929; Wed, 19 May 2021 16:34:57 -0700 (PDT) Received: from google.com (240.111.247.35.bc.googleusercontent.com. [35.247.111.240]) by smtp.gmail.com with ESMTPSA id kk7sm5054384pjb.16.2021.05.19.16.34.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 May 2021 16:34:57 -0700 (PDT) Date: Wed, 19 May 2021 23:34:53 +0000 From: Sean Christopherson To: Andy Lutomirski Cc: "Bae, Chang Seok" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , X86 ML , Herbert Xu , "Williams, Dan J" , "Hansen, Dave" , "Shankar, Ravi V" , Linux Crypto Mailing List , "linux-kernel@vger.kernel.org" Subject: Re: [RFC PATCH v2 00/11] x86: Support Intel Key Locker Message-ID: References: <20210514201508.27967-1-chang.seok.bae@intel.com> <9f556d3b-49d3-5b0b-0d92-126294ea082d@kernel.org> <247d9a25-f32f-d01b-61ff-b1966e382907@kernel.org> <112f7ceb-d699-fc1e-ea5f-89d505e0d6d8@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <112f7ceb-d699-fc1e-ea5f-89d505e0d6d8@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, May 19, 2021, Andy Lutomirski wrote: > On 5/18/21 10:52 AM, Sean Christopherson wrote: > > On Tue, May 18, 2021, Andy Lutomirski wrote: > >> On 5/17/21 11:21 AM, Bae, Chang Seok wrote: > >>> First of all, there is an RFC series for KVM [2]. > >>> > >>> Each CPU has one internal key state so it needs to reload it between guest and > >>> host if both are enabled. The proposed approach enables it exclusively; expose > >>> it to guests only when disabled in a host. Then, I guess a guest may enable it. > >> > >> I read that series. This is not a good solution. > >> > >> I can think of at least a few reasonable ways that a host and a guest > >> can cooperate to, potentially, make KL useful. > >> > >> a) Host knows that the guest will never migrate, and guest delegates > >> IWKEY management to the host. The host generates a random key and does > >> not permit the guest to use LOADIWKEY. The guest shares the random key > >> with the host. Of course, this means that a host key handle that leaks > >> to a guest can be used within the guest. > > > > If the guest and host share a random key, then they also share the key handle. > > And that handle+key would also need to be shared across all guests. I doubt this > > option is acceptable on the security front. > > > > Indeed. Oddly, SGX has the exact same problem for any scenario in which > SGX is used for HSM-like functionality, and people still use SGX. The entire PRM/EPC shares a single key, but SGX doesn't rely on encryption to isolate enclaves from other software, including other enclaves. E.g. Intel could ship a CPU with the EPC backed entirely by on-die cache and avoid hardware encryption entirely. > However, I suspect that there will be use cases in which exactly one VM > is permitted to use KL. Qubes might want that (any Qubes people around?)