Commit 1d696c4
authored
[8.2] [MOD-11650] Fix Out-of-Bounds Write in Vector Preprocessing (#794)
[MOD-11650] Fix Out-of-Bounds Write in Vector Preprocessing (#784)
* rename dataSize->getStoredDataSize
* missing rename
* format
* add input blob size to AbstractIndexInitParams
in VecSimIndexAbstract move data members to private when possible
DONT FIX LEAK YET
Factories:
move NewAbstractInitParams to a general location (new file factory_utils)
replace it in all factories
* try sanitizer
* run sanitizer
* runanyway
* rervt task unit test
use sanitizer in pull request
* fix leak in input bob size
* fix int8/uint8 elementSizeEstimation tests
This caused a buffer overflow because setup<TieredIndexParams> didn't set the data type to INT8, creating a float32 index instead.
DataBlock::addElement() tries to copy dim * sizeof(float) bytes, but the allocated buffer is only dim * sizeof(int8) bytes, causing a read overflow.
* run codecov with sanitizer (also intek)
* some fixes and assertion
* fix uint8
* fix again
* fix possible warning abour divison by zero by checking quantBits with constexpr
* TO REVERT!
fix leaks that will be moved to a separate PR
it was failing only with codecov becuase only there we use FP64_TESTS=1
Prevent template deduction errors in GenerateAndAddVector by making data_t parameter non-deducible
Used std::type_identity<data_t>::type for the value parameter to force explicit template specification (e.g., GenerateAndAddVector<double>()) instead of allowing compiler to incorrectly deduce int from literal values, which caused buffer overflows when index expected different data types.
* Revert "TO REVERT!"
This reverts commit af844ec.
* rever ci changes
* calculate EstimateElementSize accroding to the stored vector size
add tests
* revert unrelated change in cmake.san
* add batch itertor blob correctness to int8 tests
fix getQueryBlob in tiered
add getHNSWIterator to tiered batch itertor if its BUILD_TESTS
* apply suggesting
(cherry picked from commit 9fb223a)1 parent 3814aaa commit 1d696c4
File tree
28 files changed
+247
-162
lines changed- cmake
- src/VecSim
- algorithms
- brute_force
- hnsw
- svs
- index_factories
- utils
- tests/unit
28 files changed
+247
-162
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | | - | |
| 66 | + | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | | - | |
| 66 | + | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1182 | 1182 | | |
1183 | 1183 | | |
1184 | 1184 | | |
1185 | | - | |
| 1185 | + | |
1186 | 1186 | | |
1187 | 1187 | | |
1188 | 1188 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
| 93 | + | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | | - | |
| 65 | + | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| 182 | + | |
| 183 | + | |
182 | 184 | | |
183 | 185 | | |
184 | 186 | | |
185 | 187 | | |
186 | 188 | | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
187 | 193 | | |
188 | 194 | | |
189 | 195 | | |
| |||
542 | 548 | | |
543 | 549 | | |
544 | 550 | | |
545 | | - | |
| 551 | + | |
546 | 552 | | |
547 | 553 | | |
548 | 554 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | | - | |
| 185 | + | |
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| 191 | + | |
191 | 192 | | |
192 | 193 | | |
193 | 194 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
0 commit comments