rocksdb/db/blob
Omkar Gawde a066318a31 Fix out-of-bounds access in BlobFileReader::MultiGetBlob (#14427)
Summary:
Pull Request resolved: https://github.com/facebook/rocksdb/pull/14427

In `MultiGetBlob()`, the `adjustments` autovector is populated only for blob
requests that pass validation. Requests that fail validation are skipped via
`continue`, so `adjustments` has fewer entries than `blob_reqs`. When consuming
results, `adjustments[i]` uses the `blob_reqs` index instead of the
`read_reqs`/`adjustments` index, causing an out-of-bounds read when any request
fails validation.

Fix: Replace `adjustments[i]` with `adjustments[j - 1]`, since `j` tracks the
position in `read_reqs`/`adjustments` and has already been post-incremented.

Reviewed By: hx235

Differential Revision: D95303356

fbshipit-source-id: a264ae6481f74ce33f64e40624441d666135bcd0
2026-03-09 16:57:24 -07:00
..
blob_constants.h Move BlobDB related files under db/ to db/blob/ (#6519) 2020-03-12 11:00:56 -07:00
blob_contents.cc Major Cache refactoring, CPU efficiency improvement (#10975) 2023-01-11 14:20:40 -08:00
blob_contents.h Support compressed and local flash secondary cache stacking (#11812) 2023-09-21 20:30:53 -07:00
blob_counting_iterator.h Refactor AddRangeDels() + consider range tombstone during compaction file cutting (#11113) 2023-02-22 12:28:18 -08:00
blob_counting_iterator_test.cc Print stack traces on frozen tests in CI (#10828) 2022-10-18 00:35:35 -07:00
blob_fetcher.cc Support readahead during compaction for blob files (#9187) 2021-11-19 17:53:47 -08:00
blob_fetcher.h Support readahead during compaction for blob files (#9187) 2021-11-19 17:53:47 -08:00
blob_file_addition.cc Print blob file checksums as hex (#8437) 2021-06-22 09:49:44 -07:00
blob_file_addition.h Move BlobDB related files under db/ to db/blob/ (#6519) 2020-03-12 11:00:56 -07:00
blob_file_addition_test.cc Print stack traces on frozen tests in CI (#10828) 2022-10-18 00:35:35 -07:00
blob_file_builder.cc Migrate blob handling to new compression APIs (#14234) 2026-01-14 09:35:16 -08:00
blob_file_builder.h Migrate blob handling to new compression APIs (#14234) 2026-01-14 09:35:16 -08:00
blob_file_builder_test.cc Remove obsolete compression code and some .h->.cc movement (#14325) 2026-02-13 11:18:05 -08:00
blob_file_cache.cc Fix a leak of open Blob files (#13106) 2024-10-31 15:29:30 -07:00
blob_file_cache.h Fix a leak of open Blob files (#13106) 2024-10-31 15:29:30 -07:00
blob_file_cache_test.cc Group SST write in flush, compaction and db open with new stats (#11910) 2023-12-29 15:29:23 -08:00
blob_file_completion_callback.h Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
blob_file_garbage.cc Move BlobDB related files under db/ to db/blob/ (#6519) 2020-03-12 11:00:56 -07:00
blob_file_garbage.h Move BlobDB related files under db/ to db/blob/ (#6519) 2020-03-12 11:00:56 -07:00
blob_file_garbage_test.cc Print stack traces on frozen tests in CI (#10828) 2022-10-18 00:35:35 -07:00
blob_file_meta.cc Add BlobMetaData retrieval methods (#8273) 2021-06-28 08:13:29 -07:00
blob_file_meta.h Fix build (#13579) 2025-04-28 13:35:48 -07:00
blob_file_reader.cc Fix out-of-bounds access in BlobFileReader::MultiGetBlob (#14427) 2026-03-09 16:57:24 -07:00
blob_file_reader.h Migrate blob handling to new compression APIs (#14234) 2026-01-14 09:35:16 -08:00
blob_file_reader_test.cc Fix out-of-bounds access in BlobFileReader::MultiGetBlob (#14427) 2026-03-09 16:57:24 -07:00
blob_garbage_meter.cc Add a class for measuring the amount of garbage generated during compaction (#8426) 2021-06-21 22:25:30 -07:00
blob_garbage_meter.h Add a class for measuring the amount of garbage generated during compaction (#8426) 2021-06-21 22:25:30 -07:00
blob_garbage_meter_test.cc Print stack traces on frozen tests in CI (#10828) 2022-10-18 00:35:35 -07:00
blob_index.h V2 serialization format for wide columns with blob references (#14314) 2026-02-21 06:19:45 -08:00
blob_log_format.cc Remove local static string (#8103) 2022-08-05 23:03:51 -07:00
blob_log_format.h Run clang-format on db/blob/ (#10856) 2022-10-24 16:00:32 -07:00
blob_log_sequential_reader.cc Group rocksdb.sst.read.micros stat by different user read IOActivity + misc (#11444) 2023-08-08 17:26:50 -07:00
blob_log_sequential_reader.h Fix a issue with initializing blob header buffer (#8537) 2021-08-02 17:15:06 -07:00
blob_log_writer.cc Group SST write in flush, compaction and db open with new stats (#11910) 2023-12-29 15:29:23 -08:00
blob_log_writer.h Group SST write in flush, compaction and db open with new stats (#11910) 2023-12-29 15:29:23 -08:00
blob_read_request.h Enable blob caching for MultiGetBlob in RocksDB (#10272) 2022-06-30 13:24:35 -07:00
blob_source.cc Standardize on clang-format version 18 (#13233) 2024-12-19 10:58:40 -08:00
blob_source.h Refactor table_factory into MutableCFOptions (#13077) 2024-10-17 14:13:20 -07:00
blob_source_test.cc Migrate blob handling to new compression APIs (#14234) 2026-01-14 09:35:16 -08:00
db_blob_basic_test.cc Support the on-demand loading of blobs during iteration (#13069) 2024-10-16 12:34:57 -07:00
db_blob_compaction_test.cc Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
db_blob_corruption_test.cc Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
db_blob_index_test.cc Access DBImpl* and CFD* by CFHImpl* in Iterators (#12395) 2024-03-01 10:28:20 -08:00
prefetch_buffer_collection.cc Refactor FilePrefetchBuffer code (#12097) 2024-01-05 09:29:01 -08:00
prefetch_buffer_collection.h Support readahead during compaction for blob files (#9187) 2021-11-19 17:53:47 -08:00