mbox series

[0/5] selftests/sgx: Fix compilation errors.

Message ID 20230724165832.15797-1-jo.vanbulck@cs.kuleuven.be (mailing list archive)
Headers show
Series selftests/sgx: Fix compilation errors. | expand

Message

Jo Van Bulck July 24, 2023, 4:58 p.m. UTC
Hi,

This patch series ensures that all SGX selftests succeed when compiling
with optimizations (as tested with -O{0,1,2,3,s} for both gcc 11.3.0 and
clang 14.0.0). The aim of the patches is to avoid reliance on undefined,
compiler-specific behavior that can make the test results fragile.

If deemed useful, I can also include an elementary wrapper shell script to
compile and run the tests for different compilers (gcc/clang) and
optimization levels.

Best,
Jo

Jo Van Bulck (5):
  selftests/sgx: Fix uninitialized pointer dereference in error path.
  selftests/sgx: Fix function pointer relocation in test enclave.
  selftests/sgx: Ensure correct secinfo struct alignment in test
    enclave.
  selftests/sgx: Ensure expected enclave data buffer size and placement.
  selftests/sgx: Enclave freestanding compilation + separate linker
    options.

 tools/testing/selftests/sgx/Makefile            | 12 +++++++-----
 tools/testing/selftests/sgx/sigstruct.c         |  2 +-
 tools/testing/selftests/sgx/test_encl.c         | 17 +++++++++++------
 tools/testing/selftests/sgx/test_encl.lds       |  2 ++
 .../testing/selftests/sgx/test_encl_bootstrap.S |  5 +++++
 5 files changed, 26 insertions(+), 12 deletions(-)


base-commit: ad0dbc1609ab4b01c9c423d3dd6bb6e4f19dee70

Comments

Jarkko Sakkinen July 28, 2023, 7:01 p.m. UTC | #1
On Mon Jul 24, 2023 at 4:58 PM UTC, Jo Van Bulck wrote:
> Hi,
>
> This patch series ensures that all SGX selftests succeed when compiling
> with optimizations (as tested with -O{0,1,2,3,s} for both gcc 11.3.0 and
> clang 14.0.0). The aim of the patches is to avoid reliance on undefined,
> compiler-specific behavior that can make the test results fragile.
>
> If deemed useful, I can also include an elementary wrapper shell script to
> compile and run the tests for different compilers (gcc/clang) and
> optimization levels.

Thank you, this sounds like an appropriate scope for the selftest.

I support also the idea of refining the selftest as a run-time, which
could perhaps consist of the following steps:

1. Create a repository of the self-compiling selftest with GPLv2. You
   could add also AUTHORS file for the initial content by crawling this
   data from the git log.
2. Create a commit with sob's from the required stakeholders, which
   changes the license to something more appropriate, and get the
   sob's with some process.

BR, Jarkko