Skip to content

Skip empty embedded TA binaries during registration - #1197

Open
Praveen K Paladugu (praveen-pk) wants to merge 1 commit into
microsoft:mainfrom
praveen-pk:regsiter_ta_fix
Open

Skip empty embedded TA binaries during registration#1197
Praveen K Paladugu (praveen-pk) wants to merge 1 commit into
microsoft:mainfrom
praveen-pk:regsiter_ta_fix

Conversation

@praveen-pk

Copy link
Copy Markdown
Contributor

Avoid panicking during initialization when an embedded TA binary is an empty placeholder.

Fixes: e33f6ff: share TA binaries through a global UUID map

Avoid panicking during initialization when an embedded TA binary
is an empty placeholder.

Fixes: e33f6ff: share TA binaries through a global UUID map

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
@praveen-pk

Copy link
Copy Markdown
Contributor Author

Without this fix LiteBox panics at:

panicked at litebox_runner_lvbs/src/lib.rs:1358:9:
assertion failed: register_embedded_ta(shim, ta_binary)

@sangho2 Sangho Lee (sangho2) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I left a comment.

for ta_binary in TA_BINARIES {
assert!(register_embedded_ta(shim, ta_binary));
if !ta_binary.is_empty() {
assert!(register_embedded_ta(shim, ta_binary));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If an empty placeholder is legitimate, we might not need assert, or debug_assert might be better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants