lucadibello opened a new pull request, #53:
URL: https://github.com/apache/teaclave-java-tee-sdk/pull/53

   ## Description
   
   The SDK currently builds on Ubuntu 18.04 with an SGX SDK compiled from the 
linux-sgx `stdc_ex_1.0` tag (2.17.1) and GraalVM 22.2 for JDK 11. Ubuntu 18.04 
and GraalVM 22.2 are out of support, and no released SGX SDK ships the 
`stdc_ex` layer the enclave depends on. This PR moves the SDK to Ubuntu 26.04, 
Intel SGX SDK 2.30 / DCAP 1.27 and GraalVM CE 25.6.5.1 (JDK 25). It is the 
first of two PRs; the second one (multi-threading support in `TEE_SDK` mode) 
builds on top of it.
   
   I did this work while building 
[ConfidentialStorm](https://github.com/lucadibello/confidential-storm) for my 
Master's thesis, [*Secure Differentially Private Stream 
Processing*](https://thesis.bul.sbu.usi.ch/theses/2521-2526DiBello/pdf?1782979668)
 (USI, 2026), which runs its enclaves on this SDK.
   
   ## Changes
   
   - **Rebuild Intel `sgx-stdc-ex`:** Intel only shipped this in the 
`linux-sgx` tag `stdc_ex_1.0` (see [here]()), so newer SDKs cannot build the 
enclave. We now rebuild this layer from source in 
`third-party-libs/sgx-stdc-ex` and install into the SGX SDK. `LICENSE` and 
`licenses/` list the bundled files per license.
   - **GraalVM 25 / SGX 2.30 port:**
     - Features are registered with `--features`
     - The image heap is copied into enclave memory 
(`CopyingImageHeapProvider`) instead of being mapped from the image file (the 
old approach was failing).
     - libc symbols missing from the trusted libc are provided by 
`sdk/native/stubs/libc_stubs.c`.
     - The isolate is torn down from the calling thread.
     - `build_app` links `libsimdsort` and uses 64 KiB pages, so `sgx_sign` no 
longer rejects enclaves for overlapping segments.
     - JNI and EDL prototypes follow the SGX SDK 2.30 `edger8r` output, and 
`THROW_EXCEPTION` returns a value (GCC 14+).
     - Maven plugins are updated, and `maven.compiler.proc=full` keeps 
`@AutoService` working on JDK 23+.
   - **BouncyCastle 1.80:** adds native-image configs for `bcprov-jdk18on` 1.80 
(the 1.70 configs without the classes that no longer exist).
   - **Build environment:** a top-level `Makefile` (`make deps / sdk / install 
/ test`), an Ubuntu 26.04 Dockerfile (SGX SDK 2.30, DCAP 1.27, GraalVM CE 25) 
and a devcontainer. `SGX_MODE=SIM` builds against the simulation runtime. 
`EMBEDDED_LIB_OS` (Occlum) is not available on Ubuntu 26.04. For this reason, 
the existing Ubuntu 18.04 / Anolis CI scripts are unchanged (let me know what 
to do about these).
   - **Tests:** host tests are moved to `src/test`, and we provide a modernized 
testing infrastructure (JUnit 6 and Surefire). The tests are are parameterized 
over `MOCK_IN_JVM`, `MOCK_IN_SVM` and `TEE_SDK` (as said in the previous point, 
no `EMBEDDED_LIB_OS` as it's not currently available).
   - **Docs:** README and `Incompatibilities.md` updated for the new toolchain.
   
   ## How has this been tested?
   
   Unfortunately I have limited access to machines with SGX-enabled CPUs, so I 
could only test in simulation mode (`SGX_MODE=SIM`). The `TEE_SDK` enclave is 
built, linked and signed exactly as for hardware, but runs on the SGX SDK's 
simulation runtime. Remote attestation needs real hardware, so its test is 
skipped. I would be grateful if someone with SGXv2 hardware could run `make 
install && make test` on this branch.
   
   In the Ubuntu 26.04 devcontainer (`.devcontainer/Dockerfile`):
   
   ```sh
   make install SGX_MODE=SIM
   make test SGX_MODE=SIM
   ```
   
   Results:
   
   - `test/enclave`: 5 tests, 0 failures.
   - `test/host` (`MOCK_IN_JVM`, `MOCK_IN_SVM` and `TEE_SDK` in simulation): 46 
tests, 0 failures, 1 skipped (`TestRemoteAttestation`).
   
   I will open the second PR in the next days.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to