Skip to content

Commit

Permalink
[PAL] Fix attestation LibOS regression test for UBSan
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
dimakuv committed Sep 24, 2024
1 parent 76a010e commit 3e4bad8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pal/src/host/linux-sgx/pal_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,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) {
Expand Down

0 comments on commit 3e4bad8

Please sign in to comment.