Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1438029ybt; Thu, 25 Jun 2020 06:12:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/iCe4NPJXQnygRn4vclkM0dUCVLB5WSbuZ4WdIS+ehdNPD2kWGY/2Jk1WZyQd9JfaIjyh X-Received: by 2002:aa7:c54e:: with SMTP id s14mr18372751edr.81.1593090776361; Thu, 25 Jun 2020 06:12:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593090776; cv=none; d=google.com; s=arc-20160816; b=pp2CIegLcYq2nasOJP8k0jCoX9lDM/ndLEkVo5Y0f9R1pcBRDGHW/q0gPo3rZ7hIYt /G1k4QXq2SLcXC/BTgQNzauNQqdVsf3vEb0bvUnbZc4uQ1BxkTHmoHV0ptGXdLVzuwWu ZxKUGWncn+4+NnI9+oS+G5tO7Jguz4zjbZ8X8g00eByRkZkZzxcMuq839Uzuk9zCAXar ktOwmcBRUNVIoioFiRz39qFPufT7pKKLY6ybEktppzq87plXfO8BsRZWquJ3Nco4FJBP 7cWY+y6v/Ttee/YBUYmjdgd0u29F7TRzGh0uyV0n4nnFfWJxFJWC9Bwe7M2MBucOP/Qo /tMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:in-reply-to :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=LN1Esb/7Hi/Z/DHHBSlOzerqkyDCNAofXS9512fRksY=; b=IE2Q7zggpHpo64tGpkGsJG/Jkp8cwII8OWHh3idPtOqTUndvH9+X2WxxDy0S5OL63J oKEpW/GoAa16GVZZi5wiuAUGrtZNKeruiwe6TEHfbHgIDIP/vtNLDeMBPGnsfGNRQyPf zIZdkJoEHCDfQ7dYwlmptD8ep/fTNbmvN3XUgVVRAQ6F0KpdtV6SXKsS/2VMkW+96cgF Vte3p6gEDPAAZ1Hqo48ODhSXKChN0It5Qdw+5DCKW+XWgEOaWGWGiFVvKuuaBUw+p6u6 KypUUCFX+bvFdHDJ6TGy1ssVrOVbuxxL1WfssPxpPEG7DgDLuOQzkJrvGtYZCMADQwGi 4M/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XFUKQALO; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s25si6960771ejm.394.2020.06.25.06.12.31; Thu, 25 Jun 2020 06:12:56 -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=@redhat.com header.s=mimecast20190719 header.b=XFUKQALO; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404878AbgFYNKd (ORCPT + 99 others); Thu, 25 Jun 2020 09:10:33 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:44159 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2404696AbgFYNKd (ORCPT ); Thu, 25 Jun 2020 09:10:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593090631; 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=LN1Esb/7Hi/Z/DHHBSlOzerqkyDCNAofXS9512fRksY=; b=XFUKQALOBC2xZJu/Ett5Lq9hpoB2rOfb3CcbBYRjxAT4RbzGWQwr6dhP3MlfFdkeiGYwx/ 8U/a79PSRrBXOQGCoqGktsjehtqDGY/0RXEI9tA9aBtheX9R+Ud/Tj+Jm99mbq43BqZlkU 8aWfMj1vqMBtUGbd8N/rFDhGtNRNj/Y= 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-241-kOw_BvQeM5GFVWO-Gh_oew-1; Thu, 25 Jun 2020 09:10:25 -0400 X-MC-Unique: kOw_BvQeM5GFVWO-Gh_oew-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E2452107ACF2; Thu, 25 Jun 2020 13:10:22 +0000 (UTC) Received: from localhost (ovpn-115-49.ams2.redhat.com [10.36.115.49]) by smtp.corp.redhat.com (Postfix) with ESMTP id 588BE79315; Thu, 25 Jun 2020 13:10:21 +0000 (UTC) Date: Thu, 25 Jun 2020 14:10:20 +0100 From: Stefan Hajnoczi To: "Paraschiv, Andra-Irina" Cc: linux-kernel@vger.kernel.org, Anthony Liguori , Benjamin Herrenschmidt , Colm MacCarthaigh , Bjoern Doebel , David Woodhouse , Frank van der Linden , Alexander Graf , Greg KH , Martin Pohlack , Matt Wilson , Paolo Bonzini , Balbir Singh , Stefano Garzarella , Stewart Smith , Uwe Dannowski , kvm@vger.kernel.org, ne-devel-upstream@amazon.com Subject: Re: [PATCH v4 17/18] nitro_enclaves: Add overview documentation Message-ID: <20200625131020.GD221479@stefanha-x1.localdomain> References: <20200622200329.52996-1-andraprs@amazon.com> <20200622200329.52996-18-andraprs@amazon.com> <20200623085915.GF32718@stefanha-x1.localdomain> <746fcd7d-5946-35ec-6471-8bf8dccdf400@amazon.com> MIME-Version: 1.0 In-Reply-To: <746fcd7d-5946-35ec-6471-8bf8dccdf400@amazon.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hoZxPH4CaxYzWscb" Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --hoZxPH4CaxYzWscb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 24, 2020 at 05:39:39PM +0300, Paraschiv, Andra-Irina wrote: >=20 >=20 > On 23/06/2020 11:59, Stefan Hajnoczi wrote: > > On Mon, Jun 22, 2020 at 11:03:28PM +0300, Andra Paraschiv wrote: > > > +The kernel bzImage, the kernel command line, the ramdisk(s) are part= of the > > > +Enclave Image Format (EIF); plus an EIF header including metadata su= ch as magic > > > +number, eif version, image size and CRC. > > > + > > > +Hash values are computed for the entire enclave image (EIF), the ker= nel and > > > +ramdisk(s). That's used, for example, to check that the enclave imag= e that is > > > +loaded in the enclave VM is the one that was intended to be run. > > > + > > > +These crypto measurements are included in a signed attestation docum= ent > > > +generated by the Nitro Hypervisor and further used to prove the iden= tity of the > > > +enclave; KMS is an example of service that NE is integrated with and= that checks > > > +the attestation doc. > > > + > > > +The enclave image (EIF) is loaded in the enclave memory at offset 8 = MiB. The > > > +init process in the enclave connects to the vsock CID of the primary= VM and a > > > +predefined port - 9000 - to send a heartbeat value - 0xb7. This mech= anism is > > > +used to check in the primary VM that the enclave has booted. > > > + > > > +If the enclave VM crashes or gracefully exits, an interrupt event is= received by > > > +the NE driver. This event is sent further to the user space enclave = process > > > +running in the primary VM via a poll notification mechanism. Then th= e user space > > > +enclave process can exit. > > > + > > > +[1] https://aws.amazon.com/ec2/nitro/nitro-enclaves/ > > > +[2] https://www.kernel.org/doc/Documentation/vm/hugetlbpage.txt > > > +[3] https://lwn.net/Articles/807108/ > > > +[4] https://www.kernel.org/doc/html/latest/admin-guide/kernel-parame= ters.html > > > +[5] https://man7.org/linux/man-pages/man7/vsock.7.html > > Is the EIF specification and the attestation protocol available? >=20 > For now, they are not publicly available. Once the refs are available (e.= g. > AWS documentation, GitHub documentation), I'll include them in the kernel > documentation as well. >=20 > As a note here, the NE project is currently in preview > (https://aws.amazon.com/ec2/nitro/nitro-enclaves/) and part of the > documentation / codebase will be publicly available when NE is generally > available (GA). This will be in addition to the ones already publicly > available, like the NE kernel driver. >=20 > Let me know if I can help with any particular questions / clarifications. Thanks! Stefan --hoZxPH4CaxYzWscb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEyBAEBCAAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAl70ojwACgkQnKSrs4Gr c8hY1Af49KQr66earh3/QlA88cMkax3Hj7qRR9/hKpBS8qDRjwSHzSDhvemS0Qrf jH84GXs6j8Kjj2VdXFpyEaH183Ktz+27ydyMETDYpAvakhvOkBW5bSE6qqpK/EE1 CuI2kIDVBDSCxul81JSB4ATnAfa6plUgUntTUjF4mhvLBWp3HgYW6S07o5LvzaD9 6XcoDarRxGWErRs/3tVPHQrTtpMztrIxkp3eu+AiPdQuID4JUiKSzgMSne1lThRP 9OZjF1nyAkx+UxBDFYpf5MmyKB4aEUz6UmFdLKoIGYExnAfuS+9rMtgWW+Rcnwpc uwLL0sfOGSkX8jJwQJWTV+ItlRhy =dz1i -----END PGP SIGNATURE----- --hoZxPH4CaxYzWscb--