Skip to content

Commit

Permalink
Check output of ecall_restore is outside enclave
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 334265380
Change-Id: Ifbaead6bce56f01b2a4d69f53ca508d0138f6f61
  • Loading branch information
kongoshuu committed Sep 28, 2020
1 parent c712eb9 commit 382da2b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion asylo/platform/primitives/sgx/ecalls.cc
Expand Up @@ -64,7 +64,9 @@ int ecall_restore(const char *input, uint64_t input_len, char **output,
if (!asylo::primitives::TrustedPrimitives::IsOutsideEnclave(input,
input_len) ||
!asylo::primitives::TrustedPrimitives::IsOutsideEnclave(
output_len, sizeof(uint64_t))) {
output_len, sizeof(uint64_t)) ||
!asylo::primitives::TrustedPrimitives::IsOutsideEnclave(output,
*output_len)) {
asylo::primitives::TrustedPrimitives::BestEffortAbort(
"ecall_restore: input/output found to not be in untrusted memory.");
}
Expand Down

0 comments on commit 382da2b

Please sign in to comment.