Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Attestation protocol #44

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Conversation

dubek
Copy link
Contributor

@dubek dubek commented Mar 29, 2023

Implement most of the attestation protocol with its two calls, according to the SVSM spec.

This is still WIP because it still misses:

  1. Call to openssl SHA-512 routine to build the report data
  2. Actual call to hypervisor to get the attestation report

Once we have these features in linux-svsm I can rebase and plug them into the mocks that I left in src/protocols/attestation.rs (functions todo_sha_512() and get_snp_attestation_report()).


In order to test this I implemented an attestation SVSM call in OVMF during boot.
I had to modify AsmVmgExitSvsm to optionally fill a struct with the response register values. I'll point to these changes soon.

@dubek dubek force-pushed the attestation-protocol branch from c158b33 to c93f563 Compare April 24, 2023 06:58
dubek added 5 commits May 4, 2023 14:14
Prepare to use it in other places outside the core protocol.

No functional change intended.

Signed-off-by: Dov Murik <[email protected]>
No functional change intended.

Signed-off-by: Dov Murik <[email protected]>
Introduce a global SERVICES object to register SVSM services and their
data, and functionality to serialize the services list to a binary
manifest according to the SVSM spec.

Signed-off-by: Dov Murik <[email protected]>
Implement the entire body of the attestation protocol with its two
calls, according to the SVSM spec.

This is still WIP because it still misses:
1. Call to openssl SHA-512 routine to build the report data
2. Actual call to hypervisor to get the attestation report

Signed-off-by: Dov Murik <[email protected]>
Handle attestation protocol requests in handle_request().

Make the CORE_QUERY_PROTOCOL return supported versions (1) of the
attestation protocol (1).

Signed-off-by: Dov Murik <[email protected]>
@dubek
Copy link
Contributor Author

dubek commented Jun 5, 2023

I pushed a v2 of this branch (7 patches) to https://github.com/svsm-vtpm/linux-svsm/tree/attestation-protocol-v2 :

I have a PoC guest linux kernel support of getting the attestation report via SVSM; I implemented it as another ioctl in /dev/sev-guest. I'll probably share these patches soon.

I succeeded starting a guest and fetching a VMPL0 report via SVSM and a VMPL1 report via "regular" guest message request.

@dubek
Copy link
Contributor Author

dubek commented Jun 7, 2023

Update: I published the guest kernel RFC patch series for getting SVSM attestation report
https://lore.kernel.org/linux-coco/[email protected]/

It uses the SVSM_ATTEST_SERVICES call implemented in the attestation-protocol-v2 branch (mentioned in the previous comment).

@dubek
Copy link
Contributor Author

dubek commented Jun 8, 2023

... and here is a simple guest userspace program to call the new SNP_SVSM_ATTEST_SERVICES ioctl (defined in the kernel RFC patches mentioned above) and save the responses in local files:
https://gist.github.com/dubek/0e0a419fecf2ca87dd65d483d5c446d5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant