Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1533729pxb; Wed, 20 Oct 2021 07:01:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxBPtyVB8hzLzFe6rR4MVuFs0thFrNQczbyIDS2nUX1/m+4Gpyq8YbH1dH4Prfv98fbCfAW X-Received: by 2002:a17:903:31d7:b0:13f:16cc:291f with SMTP id v23-20020a17090331d700b0013f16cc291fmr39310910ple.17.1634738502430; Wed, 20 Oct 2021 07:01:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634738502; cv=none; d=google.com; s=arc-20160816; b=cOpp5y5g1zctGD+bhOxaG6sE64Ku+fdjLG5CEKxOw+ox6Nnwn/HFhf7IO7+rmr16iX lBLDLKJ3X3pzBSjCGczJ0Mk9BqULTU9QOIlX/q0y2x1fZLIU0Vj0YNsY6w0ngBq10139 FO9BtUUdwSWG4027D/6B+sCADYUfxuBZw+hLViaHmNA2jF5o9jjhNwv4BKPB4oLYfNgT w1bvQ3P1BsDHSJuw3OK+nkDycx9QCjirOf71BlBlq+OxMKPltMo6W2b6kNJEvh+UlG8N aW0KG8tRQbMlWzy3p/fe2wOGh1HsFIbdoH8yLS+j1RvL6meAejXRgHDHJ8+M2uhuOutQ QkXg== 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=L03YmQ0pIfGEGD9f4KlDAspK5AaF4+EIuVOvDSkgNqE=; b=qSWFURoOqRG7ca6pVcqrhjTmaQHwq1yF6cbAKIVEyAenUtekOIa9kcIjugD+mkV6n2 JU/gY2kqtEHPsmvn/zijDtD54tQHPSI068BTwvVGLkfuDD0igTCBFandberI8HpC9LEO MevDJYs2Y7vyauTQwilYaEMnE6ffHuSxDYFWTNJcDuVwdLo+MSPfsYAuvCq44cb1BMTZ 4AD0Y7o7FwVJA17v0wjZzLGTmfdhTZCH4qhlYy/hDYmrdkSPzF/cjfMRdVgC5HKaoqnq /5/eVaQGiIut2KReUEWr9YPwkdxaF1eSYsquUXSG8v+mz/YCOxymZJUpwl2LERZsDZYZ ECnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=E8Zo6QDi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y8si3072822pgh.387.2021.10.20.07.01.26; Wed, 20 Oct 2021 07:01:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@linuxfoundation.org header.s=korg header.b=E8Zo6QDi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230391AbhJTOBp (ORCPT + 99 others); Wed, 20 Oct 2021 10:01:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:51640 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230233AbhJTOBo (ORCPT ); Wed, 20 Oct 2021 10:01:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9CACF61354; Wed, 20 Oct 2021 13:59:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1634738370; bh=EogA4m8QcEPrdZgSxOG4zqctZRvv2RAgbCI5sSqQN6U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=E8Zo6QDi6gTuq8flLTOs5+88WYCzw6dHMnFok+3MBmFzJ1ZT5yJLkUREELCYEfZ63 FuppCEhDtToFOGkwKMC5CTAjEdZQsudcrkirqI0LOXYjtrdgNHc5UjVlSAEbbvuB47 xVUr9zkn4RIbMRtfdChrESCuBkSVVUUZOcwT2Azk= Date: Wed, 20 Oct 2021 15:59:27 +0200 From: Greg KH To: Dov Murik Cc: James Bottomley , linux-efi@vger.kernel.org, Borislav Petkov , Ashish Kalra , Brijesh Singh , Tom Lendacky , Ard Biesheuvel , James Morris , "Serge E. Hallyn" , Andi Kleen , Andrew Scull , Dave Hansen , "Dr. David Alan Gilbert" , Tobin Feldman-Fitzthum , Jim Cadden , Daniele Buono , linux-coco@lists.linux.dev, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 1/3] efi/libstub: Copy confidential computing secret area Message-ID: References: <20211020061408.3447533-1-dovmurik@linux.ibm.com> <20211020061408.3447533-2-dovmurik@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 20, 2021 at 03:52:49PM +0300, Dov Murik wrote: > > > On 20/10/2021 15:11, Greg KH wrote: > > On Wed, Oct 20, 2021 at 08:00:28AM -0400, James Bottomley wrote: > >> On Wed, 2021-10-20 at 08:39 +0200, Greg KH wrote: > >>> On Wed, Oct 20, 2021 at 06:14:06AM +0000, Dov Murik wrote: > >> [...] > >>>> + help > >>>> + Copy memory reserved by EFI for Confidential Computing (coco) > >>>> + injected secrets, if EFI exposes such a table entry. > >>> > >>> Why would you want to "copy" secret memory? > >>> > >>> This sounds really odd here, it sounds like you are opening up a > >>> security hole. Are you sure this is the correct text that everyone > >>> on the "COCO" group agrees with? > >> > >> The way this works is that EFI covers the secret area with a boot time > >> handoff block, which means it gets destroyed as soon as > >> ExitBootServices is called as a security measure ... if you do nothing > >> the secret is shredded. This means you need to make a copy of it > >> before that happens if there are secrets that need to live beyond the > >> EFI boot stub. > > > > Ok, but "copy secrets" does sound really odd, so you all need a much > > better description here, and hopefully somewhere else in Documentation/ > > to describe exactly what this new API is and is to be used for. > > > > > So something like: > > > config EFI_COCO_SECRET > bool "Keep the EFI Confidential Computing secret area" > depends on EFI > help > Confidential Computing platforms (such as AMD SEV) allow for > secrets injection during guest VM launch. The secrets are > placed in a designated EFI memory area. EFI destorys > the confidential computing secret area when ExitBootServices > is called. That last sentence does not make much sense to me, sorry. > In order to use the secrets in the kernel, the secret area > must be copied to kernel-reserved memory (before it is erased). > > If you say Y here, the EFI stub will copy the EFI secret area (if > available) and reserve it for use inside the kernel. This will > allow the virt/coco/efi_secret module to access the secrets. Really this is about getting that data out to userspace, right? Should you mention that here? > and some new file like Documentation/security/coco/efi_secret.rst which > describes this whole protocol (from secret injection at VM launch > into an EFI page, through efistub and efi in linux, to the efi_secret > module which exposes the secrets). Yes, that would be good to have documented. thanks, greg k-h