Skip to content

Fix[mqbs]: bound QLIST queue record parsing and drop malformed events - #1748

Open
kaikulimu wants to merge 8 commits into
bloomberg:mainfrom
kaikulimu:fix-qlist-record-bounds
Open

Fix[mqbs]: bound QLIST queue record parsing and drop malformed events#1748
kaikulimu wants to merge 8 commits into
bloomberg:mainfrom
kaikulimu:fix-qlist-record-bounds

Conversation

@kaikulimu

@kaikulimu kaikulimu commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • FileStoreProtocolUtil::loadAppInfos returned void and never consulted the size of the application-ID area it was handed, so a declared appId count larger than the entries present read past the end. It now reports a status and bounds every field against the block.

  • The section lengths declared by a QueueRecordHeader were used without a consistency check, letting the application-ID area size underflow when computed by subtraction. loadQueueRecordLayout now derives and validates them together.

  • FileStoreUtil::writeQueueCreationRecordImpl guarded QLIST and journal capacity with BSLS_ASSERT_SAFE, and parsed the record only after copying it into the QLIST file. Capacity is now checked at runtime, and the file positions advance only once the record is validated.

  • A malformed record was indistinguishable from a failed write in FileStore::processStorageEvent and reached ExitUtil::terminate(e_STORAGE_OUT_OF_SYNC). Such a record says nothing about whether self and the primary have diverged, so it now drops the event with an alarm; a genuine write failure still terminates.

@kaikulimu
kaikulimu force-pushed the fix-qlist-record-bounds branch 3 times, most recently from 6bebd0b to e86182d Compare September 2, 2026 18:29
Signed-off-by: Yuan Jing Vincent Yan <yyan82@bloomberg.net>
Signed-off-by: Yuan Jing Vincent Yan <yyan82@bloomberg.net>
Signed-off-by: Yuan Jing Vincent Yan <yyan82@bloomberg.net>
Signed-off-by: Yuan Jing Vincent Yan <yyan82@bloomberg.net>
Signed-off-by: Yuan Jing Vincent Yan <yyan82@bloomberg.net>
Signed-off-by: Yuan Jing Vincent Yan <yyan82@bloomberg.net>
Signed-off-by: Yuan Jing Vincent Yan <yyan82@bloomberg.net>
…Event

Signed-off-by: Yuan Jing Vincent Yan <yyan82@bloomberg.net>
@kaikulimu
kaikulimu force-pushed the fix-qlist-record-bounds branch from e86182d to 37b0ad4 Compare September 2, 2026 18:30
@kaikulimu kaikulimu changed the title WIP Fix[mqbs]: bound QLIST queue record parsing and drop malformed events Sep 2, 2026
@kaikulimu
kaikulimu marked this pull request as ready for review September 2, 2026 19:08
@kaikulimu
kaikulimu requested a review from a team as a code owner September 2, 2026 19:08
@kaikulimu
kaikulimu requested a review from dorjesinpo September 2, 2026 21:29
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