Use closer-to-native RPM building#2
Closed
BrianSipos wants to merge 12 commits into
Closed
Conversation
Co-authored-by: Bill Van Besien <Bill.Van.Besien@jhuapl.edu> Co-authored-by: Stone, Joshua E. <joshua.stone@jhuapl.edu>
iondev33
pushed a commit
to iondev33/BSL
that referenced
this pull request
Feb 26, 2026
…MOS#2) Bug NASA-AMMOS#2: BSL_BundleCtx_WriteBTSD must call realloc callback before write Problem: - BSL_BundleCtx_WriteBTSD was calling the write callback directly without first ensuring the BTSD buffer was large enough - When ION creates extension blocks, they start with length=1 (placeholder) - BSL then attempted to write 82 bytes into the 1-byte buffer - This caused the ION realloc callback to be called during write, but write had already started with insufficient buffer space Root Cause: - BSL_BundleCtx_WriteBTSD (lines 131-137) immediately called: return HostDescriptorTable.block_write_btsd_fn(bundle, block_num, btsd_len); - No buffer size check or realloc call before writing - The write callback would fail when attempting to write beyond allocated space Fix: - Added realloc call before write in BSL_BundleCtx_WriteBTSD (lines 138-148) - Check if realloc callback is registered and btsd_len > 0 - Call block_realloc_btsd_fn to expand buffer to needed size - Return NULL if realloc fails (with error logging) - Only proceed to write if realloc succeeds Code: /* Ensure the BTSD buffer is large enough before writing */ if (btsd_len > 0 && HostDescriptorTable.block_realloc_btsd_fn) { int realloc_result = HostDescriptorTable.block_realloc_btsd_fn(bundle, block_num, btsd_len); if (realloc_result != 0) { BSL_LOG_ERR("Failed to realloc BTSD buffer: block=%llu size=%zu result=%d", (unsigned long long)block_num, btsd_len, realloc_result); return NULL; } } Impact: - BSL now properly expands BTSD buffers before writing - BCB encryption can now write full encrypted payloads - BIB can write full HMAC signatures - This is part of a series of fixes enabling BSL BCB encryption in ION Related ION integration fixes (separate ION commits): - Bug NASA-AMMOS#3: Fix SDR violation in ion_bsl_ReallocBTSD - Bug NASA-AMMOS#4: Add payload block special handling in ion_bsl_ReallocBTSD Test: ION tests/bpsec/bpsec-all-multinode-test.bsl Status: BSL operations now succeed with this fix WIP: bpsec/bpsec-all-multinode-test.bsl not yet passing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.