From: Alexander Graf <graf@amazon.com>
To: Dorjoy Chowdhury <dorjoychy111@gmail.com>, <qemu-devel@nongnu.org>
Cc: <agraf@csgraf.de>, <stefanha@redhat.com>, <pbonzini@redhat.com>,
<slp@redhat.com>, <richard.henderson@linaro.org>,
<eduardo@habkost.net>, <mst@redhat.com>,
<marcel.apfelbaum@gmail.com>, <berrange@redhat.com>,
<philmd@linaro.org>
Subject: Re: [PATCH v3 4/5] machine/nitro-enclave: Add built-in Nitro Secure Module device
Date: Tue, 13 Aug 2024 14:57:03 +0200 [thread overview]
Message-ID: <ebe8952e-239a-4a93-ba90-e7f633046eef@amazon.com> (raw)
In-Reply-To: <20240810164502.19693-5-dorjoychy111@gmail.com>
On 10.08.24 18:45, Dorjoy Chowdhury wrote:
> AWS Nitro Enclaves have built-in Nitro Secure Module (NSM) device which
> is used for stripped down TPM functionality like attestation. This commit
> adds the built-in NSM device in the nitro-enclave machine type.
>
> In Nitro Enclaves, all the PCRs start in a known zero state and the first
> 16 PCRs are locked from boot and reserved. The PCR0, PCR1, PCR2 and PCR8
> contain the SHA384 hashes related to the EIF file used to boot the
> VM for validation.
>
> A new optional nitro-enclave machine option 'id' has been added which will
> be the enclave identifier reflected in the module-id of the NSM device.
> Otherwise, the device will have a default id set.
>
> Signed-off-by: Dorjoy Chowdhury <dorjoychy111@gmail.com>
> ---
> hw/core/eif.c | 205 +++++++++++++++++++++++++++++++-
> hw/core/eif.h | 5 +-
> hw/core/meson.build | 4 +-
> hw/i386/Kconfig | 1 +
> hw/i386/nitro_enclave.c | 85 ++++++++++++-
> include/hw/i386/nitro_enclave.h | 19 +++
> 6 files changed, 310 insertions(+), 9 deletions(-)
>
[...]
> @@ -87,10 +106,46 @@ static void nitro_enclave_machine_state_init(MachineState *machine)
> nitro_enclave_devices_init(ne_state);
> }
>
> +static void nitro_enclave_machine_reset(MachineState *machine,
> + ShutdownCause reason)
> +{
> + NitroEnclaveMachineClass *ne_class =
> + NITRO_ENCLAVE_MACHINE_GET_CLASS(machine);
> + NitroEnclaveMachineState *ne_state = NITRO_ENCLAVE_MACHINE(machine);
> +
> + ne_class->parent_reset(machine, reason);
> +
> + memset(ne_state->vnsm->pcrs, 0, sizeof(ne_state->vnsm->pcrs));
> +
> + /* PCR0 */
> + ne_state->vnsm->extend_pcr(ne_state->vnsm, 0, ne_state->image_sha384,
> + SHA384_BYTE_LEN);
> + /* PCR1 */
> + ne_state->vnsm->extend_pcr(ne_state->vnsm, 1, ne_state->bootstrap_sha384,
> + SHA384_BYTE_LEN);
> + /* PCR2 */
> + ne_state->vnsm->extend_pcr(ne_state->vnsm, 2, ne_state->app_sha384,
> + SHA384_BYTE_LEN);
What about PCR3 and PCR4? Both are just sha384 values of input
strings[1]. Can you make these input strings NSM device as well as
machine properties as well?
[1] https://docs.aws.amazon.com/enclaves/latest/user/set-up-attestation.html
Alex
Amazon Web Services Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss
Eingetragen am Amtsgericht Charlottenburg unter HRB 257764 B
Sitz: Berlin
Ust-ID: DE 365 538 597
next prev parent reply other threads:[~2024-08-13 12:57 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-10 16:44 [PATCH v3 0/5] AWS Nitro Enclave emulation support Dorjoy Chowdhury
2024-08-10 16:44 ` [PATCH v3 1/5] machine/nitro-enclave: New machine type for AWS Nitro Enclaves Dorjoy Chowdhury
2024-08-12 13:56 ` Alexander Graf
2024-08-10 16:44 ` [PATCH v3 2/5] machine/nitro-enclave: Add vhost-user-vsock device Dorjoy Chowdhury
2024-08-12 14:24 ` Daniel P. Berrangé
2024-08-13 18:02 ` Dorjoy Chowdhury
2024-08-14 8:17 ` Alexander Graf
2024-08-10 16:45 ` [PATCH v3 3/5] device/virtio-nsm: Support for Nitro Secure Module device Dorjoy Chowdhury
2024-08-12 14:15 ` Daniel P. Berrangé
2024-08-13 12:54 ` Alexander Graf
2024-08-10 16:45 ` [PATCH v3 4/5] machine/nitro-enclave: Add built-in " Dorjoy Chowdhury
2024-08-12 13:51 ` Alexander Graf
2024-08-12 14:00 ` Daniel P. Berrangé
2024-08-12 13:55 ` Alexander Graf
2024-08-12 14:07 ` Daniel P. Berrangé
2024-08-16 12:50 ` Dorjoy Chowdhury
2024-08-16 12:57 ` Daniel P. Berrangé
2024-08-16 13:34 ` Dorjoy Chowdhury
2024-08-13 12:57 ` Alexander Graf [this message]
2024-08-10 16:45 ` [PATCH v3 5/5] docs/nitro-enclave: Documentation for nitro-enclave machine type Dorjoy Chowdhury
2024-08-18 11:51 ` [PATCH v3 0/5] AWS Nitro Enclave emulation support Dorjoy Chowdhury
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ebe8952e-239a-4a93-ba90-e7f633046eef@amazon.com \
--to=graf@amazon.com \
--cc=agraf@csgraf.de \
--cc=berrange@redhat.com \
--cc=dorjoychy111@gmail.com \
--cc=eduardo@habkost.net \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=slp@redhat.com \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.