From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1kddew-0007Rk-Ef for mharc-grub-devel@gnu.org; Fri, 13 Nov 2020 13:18:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38022) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kddDR-0000aW-PT for grub-devel@gnu.org; Fri, 13 Nov 2020 12:50:29 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:54085) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kddDP-0006XB-Tp for grub-devel@gnu.org; Fri, 13 Nov 2020 12:50:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605289827; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=M4NJUV0nm2d/34hGRkap/AkS2yUV/I5SXTsNs7afQLs=; b=Czg2wq3HmVReRjPqTtI0ct3Fmpp/MeaJHYqBpCmgOHpU7Coap9oMfoe82M70Lb80kv8b9V s72SL7tCNakfGVFmpMvuVxm8iMibfmixnE7h90i9Ncyk8kFHNNGPuvll6HiBdkOZuO9DLt jgRdU1GBue6fbvSVCTORmtDabGfrTe8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-592-ykG-nu5JObeRPZhJoj4ReQ-1; Fri, 13 Nov 2020 12:50:22 -0500 X-MC-Unique: ykG-nu5JObeRPZhJoj4ReQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7AC738049DF; Fri, 13 Nov 2020 17:50:20 +0000 (UTC) Received: from work-vm (ovpn-114-160.ams2.redhat.com [10.36.114.160]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 13EE55D9F1; Fri, 13 Nov 2020 17:50:17 +0000 (UTC) Date: Fri, 13 Nov 2020 17:50:15 +0000 From: "Dr. David Alan Gilbert" To: James Bottomley Cc: grub-devel@gnu.org, dovmurik@linux.vnet.ibm.com, Dov.Murik1@il.ibm.com, ashish.kalra@amd.com, brijesh.singh@amd.com, tobin@ibm.com, david.kaplan@amd.com, jon.grimm@amd.com, thomas.lendacky@amd.com, frankeh@us.ibm.com Subject: Re: [PATCH 0/3] Add ability to use SEV provisioned secrets for disk decryption Message-ID: <20201113175015.GS3251@work-vm> References: <20201113012206.24246-1-jejb@linux.ibm.com> MIME-Version: 1.0 In-Reply-To: <20201113012206.24246-1-jejb@linux.ibm.com> User-Agent: Mutt/1.14.6 (2020-07-11) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Received-SPF: pass client-ip=63.128.21.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/12 16:09:27 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 13 Nov 2020 13:18:52 -0500 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2020 17:50:30 -0000 * James Bottomley (jejb@linux.ibm.com) wrote: > To achieve encrypted disk images in the AMD SEV encrypted virtual > machine, we need to add the ability for grub to retrieve the disk > passphrase from the SEV launch secret. To do this, we've modified > OVMF to set aside an area for the injected secret and pass up a > configuration table for it: > > https://edk2.groups.io/g/devel/topic/78198617#67339 > > The patches in this series modify grub to look for the disk passphrase > in the secret configuration table and use it to decrypt any disks in > the system if they are found. This is so an encrypted image with a > properly injected password will boot without any user intervention. > > The three patches firstly modify the cryptodisk consumers to allow > arbitrary password getters instead of the current console based one. > The next patch adds a '-s' option to cryptodisk to allow it to use a > saved password and the final one adds a sevsecret command to check for > the secrets configuration table and provision the disk passphrase from > it if an entry is found. With all this in place, the sequence to boot > an encrypted volume without user intervention is: > > sevsecret > cryptomount -s > source (crypto0)/boot/grub.cfg I was thinking what happens if the evil admin adds an extra disc; I guess the argument here is that: a) Since you specify (crypto0) it can only be a decrypted disc b) And since only the guest owner can supply the keys, it can only be there disc image that can be decrypted. Right? Dave > Assuming there's a standard Linux root partition. > > James > > --- > > James Bottomley (3): > cryptodisk: make the password getter and additional argument to > recover_key > cryptodisk: add OS provided secret support > efi: Add API for retrieving the AMD SEV injected secret for cryptodisk > > grub-core/Makefile.core.def | 8 +++ > grub-core/disk/cryptodisk.c | 60 +++++++++++++++-- > grub-core/disk/efi/sevsecret.c | 118 +++++++++++++++++++++++++++++++++ > grub-core/disk/geli.c | 5 +- > grub-core/disk/luks.c | 12 ++-- > grub-core/disk/luks2.c | 12 ++-- > include/grub/cryptodisk.h | 8 ++- > include/grub/efi/api.h | 15 +++++ > 8 files changed, 221 insertions(+), 17 deletions(-) > create mode 100644 grub-core/disk/efi/sevsecret.c > > -- > 2.26.2 > -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK