Skip to content

Fix out-of-bounds read in FASTCOVER on small training samples#4710

Open
eyupcanakman wants to merge 1 commit into
facebook:devfrom
eyupcanakman:fix/fastcover-small-samples-4499
Open

Fix out-of-bounds read in FASTCOVER on small training samples#4710
eyupcanakman wants to merge 1 commit into
facebook:devfrom
eyupcanakman:fix/fastcover-small-samples-4499

Conversation

@eyupcanakman

Copy link
Copy Markdown
Contributor

When every training sample is smaller than the dmer size, FASTCOVER_ctx_init derives nbDmers from the training set, which splitPoint < 1 can shrink below MAX(d, 8) even after the total samples size check passes. The subtraction underflows and the builder reads past the sample buffer (#4499).

It now returns srcSize_wrong for a training set that small, the way the other invalid inputs already do. Adds a unit test in basicUnitTests.

COVER_ctx_init has the same underflow, addressed separately in #4690.

When every training sample is smaller than the dmer size, splitPoint < 1 can shrink the training set below MAX(d, 8) after the total samples size check passes, so nbDmers underflows and FASTCOVER reads past the sample buffer (facebook#4499). It now returns srcSize_wrong. Adds a unit test in basicUnitTests. The same underflow in COVER_ctx_init is addressed separately in facebook#4690.
@meta-cla meta-cla Bot added the CLA Signed label Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant