From 84043970ddf857ca3ae15fce6f11c2dd6579fd9c Mon Sep 17 00:00:00 2001 From: Dmitrii Kuvaiskii Date: Tue, 24 Sep 2024 03:11:03 -0700 Subject: [PATCH] [PAL] Fix `attestation` LibOS regression test for UBSan UBSan detects an uninitialized boolean variable on a DCAP SGX machine on the remote attestation example, failing with the message: error: ubsan: load of invalid value for bool or enum: 100 error: ubsan: ../pal/src/host/linux-sgx/pal_misc.c:724:43 This happens because `bool linkable` variable is assigned only in the EPID attestation scheme, but left unassigned in the DCAP scheme. This commit fixes this (though it's not a bug since DCAP never uses `linkable` anyway). Hence, UBSan doesn't complain anymore. Signed-off-by: Dmitrii Kuvaiskii --- pal/src/host/linux-sgx/pal_misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pal/src/host/linux-sgx/pal_misc.c b/pal/src/host/linux-sgx/pal_misc.c index c6c583a863..bb236d9cc9 100644 --- a/pal/src/host/linux-sgx/pal_misc.c +++ b/pal/src/host/linux-sgx/pal_misc.c @@ -702,7 +702,7 @@ int _PalAttestationQuote(const void* user_report_data, size_t user_report_data_s enum sgx_attestation_type attestation_type; sgx_spid_t spid; - bool linkable; + bool linkable = false; ret = parse_attestation_type(g_pal_public_state.manifest_root, &attestation_type); if (ret < 0) {