You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Additional input validation for index deserialization (#4899)
Summary:
Pull Request resolved: #4899
Add bounds checks when reading index data from untrusted
byte streams. Five new FAISS_THROW_IF_NOT_FMT guards reject
invalid values early during deserialization:
- ProductAdditiveQuantizer: nsplits must be > 0
- ScalarQuantizer: qtype must be within the valid
QuantizerType enum range
- NSG: R (max out-degree) must be > 0
- IndexPreTransform: VectorTransform chain length must
be >= 0
- IndexBinaryMultiHash: nhash must be > 0
Each check includes a descriptive error message with the
offending value. Without these checks, invalid data could
cause undefined behavior such as zero-size allocations,
out-of-range enum casts, or negative loop bounds.
Reviewed By: mnorris11
Differential Revision: D95968069
fbshipit-source-id: b9a3e88a01d3427614fa0e027fb233f11ee8cf2e
0 commit comments