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
Dmitrii Kuvaiskii authored and mkow committed Sep 26, 2024
1 parent aef087f commit 8404397
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 @@ -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) {
Expand Down

0 comments on commit 8404397

Please sign in to comment.