diff options
author | Reinette Chatre <reinette.chatre@intel.com> | 2022-02-09 00:48:40 +0300 |
---|---|---|
committer | Dave Hansen <dave.hansen@linux.intel.com> | 2022-02-12 00:52:47 +0300 |
commit | fff36bcbfde1126f6b81cb8ee12a58aada17ca29 (patch) | |
tree | a4ef7d5b59bed483e5558d2712e4fc81e5a49c20 /tools | |
parent | 2d03861e0d1d1ee81efc59338101cdd86a7474f6 (diff) | |
download | linux-fff36bcbfde1126f6b81cb8ee12a58aada17ca29.tar.xz |
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: 1b35eb719549 ("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
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/sgx/main.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/selftests/sgx/main.c b/tools/testing/selftests/sgx/main.c index 370c4995f7c4..a7cd2c3e6f7e 100644 --- a/tools/testing/selftests/sgx/main.c +++ b/tools/testing/selftests/sgx/main.c @@ -147,6 +147,7 @@ static bool setup_test_encl(unsigned long heap_size, struct encl *encl, if (!encl_load("test_encl.elf", encl, heap_size)) { encl_delete(encl); TH_LOG("Failed to load the test enclave.\n"); + return false; } if (!encl_measure(encl)) |