Skip to content

Commit fff36bc

Browse files
rchatrehansendc
authored andcommitted
selftests/sgx: Do not attempt enclave build without valid enclave
It is not possible to build an enclave if it was not possible to load the binary from which it should be constructed. Do not attempt to make further progress but instead return with failure. A "return false" from setup_test_encl() is expected to trip an ASSERT_TRUE() and abort the rest of the test. Fixes: 1b35eb7 ("selftests/sgx: Encpsulate the test enclave creation") Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com> Acked-by: Dave Hansen <dave.hansen@linux.intel.com> Acked-by: Shuah Khan <skhan@linuxfoundation.org> Link: https://lkml.kernel.org/r/e3778c77f95e6dca348c732b12f155051d2899b4.1644355600.git.reinette.chatre@intel.com
1 parent 2d03861 commit fff36bc

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

  • tools/testing/selftests/sgx

tools/testing/selftests/sgx/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ static bool setup_test_encl(unsigned long heap_size, struct encl *encl,
147147
if (!encl_load("test_encl.elf", encl, heap_size)) {
148148
encl_delete(encl);
149149
TH_LOG("Failed to load the test enclave.\n");
150+
return false;
150151
}
151152

152153
if (!encl_measure(encl))

0 commit comments

Comments
 (0)