-
Notifications
You must be signed in to change notification settings - Fork 3
Attestation support for amd-sev #1
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
base: xen-fastabi-sev
Are you sure you want to change the base?
Conversation
tools/include/libxl.h
Outdated
/* | ||
* Used to retrieve for a domain using coco | ||
*/ | ||
int libxl_domain_attestation(libxl_ctx *ctx, uint32_t domain_id, FILE *file, bool is_mmonce_file, char *mmonce); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
domain_id
-> domid
I don't think exposing FILE *
in the ABI is wise, if streaming something is absolutely necessary, a fd would be preferable.
xen/include/public/hvm/coco.h
Outdated
DEFINE_XEN_GUEST_HANDLE(coco_prepare_initial_mem_t); | ||
|
||
struct coco_attestation_report { | ||
uint32_t handle; /* IN */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be domid_t domid;
instead
void* address; /* In */ | ||
uint8_t mnonce[16]; /* In */ | ||
uint32_t len; /* In/Out */ | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's (almost) the same struct as the previous one
tools/libs/light/libxl_domain.c
Outdated
} | ||
|
||
report.handle = domain_id; | ||
report.address = &result; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
userland virtual addresses (e.g pointers) in hypercalls is incorrect even though it often works (but can randomly fail depending on how the process memory is managed)
xen/common/coco.c
Outdated
char resp[208]; | ||
|
||
d = get_domain_by_id(report.handle); | ||
rc = d->coco_ops->domain_attestation_report(d, report, resp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to check that :
- domain actually exists (d != NULL); report -ENOENT otherwise
- domain is confidential computing (is_coco_domain); report -EINVAL otherwise
d->coco_ops
&&d->coco_ops->domain_attestation_report
(so that platforms that don't support it don't cause NULL dereference); report -EOPNOTSUPP (or -ENODEV?) otherwise
No description provided.