Repository navigation
Conversation
ofdm_set_sync(UN_SYNC) reset sync_state to search and zeroed rxbuf but left rxbufst where it was. After a postamble sync -- which backs rxbufst up by np * samplesperframe to the start of the packet -- the position sat below its normal search value, and a second UN_SYNC while the decoder was in trial froze it there. The next postamble detection then subtracted another np * samplesperframe: rxbufst went below rxbuf and burst acquisition read outside the buffer (ASan SEGV in est_timing_and_freq via ofdm_sync_search_burst). UN_SYNC now sets rxbufst = nrxbufhistory, the same reset the state machine itself does on its other two returns to search. Deterministic public-API reproducer and diagnosis in drowe67#79. Co-authored-by: Rafael Diniz <rafael@riseup.net>
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.
Fixes the out-of-bounds read described in #79.
ofdm_set_sync(UN_SYNC)reset the sync state machine tosearchand zeroedrxbuf, but leftrxbufstwhere it was. After a postamble sync — which backsrxbufstup bynp * samplesperframeto the start of the packet — the position sat below its normal search value. A secondUN_SYNCwhile the decoder was in trial froze it there, and the next postamble detection subtracted anothernp * samplesperframe:rxbufstwent belowrxbufand burst acquisition read outside the buffer (ASan SEGV inest_timing_and_freqviaofdm_sync_search_burst).UN_SYNCnow setsrxbufst = nrxbufhistory, the same reset the sync state machine itself does on its other two returns to search.The reproducer in #79 is public-API-only and deterministic: on stock
mainit SEGVs within three bursts; with this line it runs to completion with no ASan report.Diagnosis by Rafael Diniz; the original find was in Rhizomatica's Mercury (PR #455, fixed there in #457, shipped in 1.9.22).
Co-authored-by: Rafael Diniz rafael@riseup.net