fix(attestation): keep enclave exit hooks local in EMU - #246
Haitao Huang (haitaohuang) wants to merge 2 commits into
Conversation
Localize the enclave atexit and __cxa_atexit definitions in the application-only archive. This avoids glibc's duplicate atexit definition and preserves native process-exit callbacks without altering the firmware archive. Add native regression coverage for callbacks, archive integrity, repeatability, and objcopy failure handling in CI and the local gauntlet. Signed-off-by: Haitao Huang <haitaohuang@microsoft.com> Assisted-by: Copilot:gpt-6-astra Copilot-Session: a093a474-2f2c-42b1-97e5-7477359fb7bd
|
The GitHub GNU ld jobs exposed an additional archive-ordering dependency that the local LLD run did not: the late static libcrypto needs libc rescanned after its atexit reference. I reproduced this locally with a regression that reads both build scripts’ emitted library order and links with GNU ld plus -nodefaultlibs. Adding -lc after the native archives fixes that regression, and the real hosted binary now builds with GNU ld. Full local revalidation is running before the corrective update is pushed. |
Rescan libc after the hosted native archives in both build scripts. GNU ld otherwise leaves static OpenSSL's late atexit reference unresolved after the enclave exit stubs are localized. Exercise the actual emitted library order with GNU ld and -nodefaultlibs in the native regression, rather than relying on LLD's archive rescanning. Signed-off-by: Haitao Huang <haitaohuang@microsoft.com> Assisted-by: Copilot:gpt-6-astra Copilot-Session: a093a474-2f2c-42b1-97e5-7477359fb7bd
|
The corrective head 0817b81 is fully validated. All pull-request workflows passed, and the extra push-run job that hit a transient OpenSSL download TLS failure also passed on retry. All 116 check runs are now successful. Local verification also passed the complete gauntlet, the real GNU-linked hosted build, and the native regression for library ordering, exit callbacks, archive integrity, and failure propagation. |
Summary
atexitand__cxa_atexitstubs in the application-onlylibservtd_attest_app.a. This avoids a duplicateatexitdefinition with glibc'slibc_nonshared.aand lets host exit callbacks use libc.libservtd_attest.aunchanged.atexitreference as well as LLD does.objcopyfailures; run it in the EMU workflow and local gauntlet.Validation
-fuse-ld=bfd -nodefaultlibsand built the real hosted binary with-C linker-features=-lld.