Details
-
Bug
-
Resolution: Fixed
-
Major
-
5.5.0
-
Untriaged
-
Unknown
Description
As identified by UBSan, CouchKVStore::rollback() doesn't check the return value of resdVBState; which can result in it attempting to write a null local document to the rolled-back vBucket:
[ RUN ] CouchKVStoreErrorInjectionTest.readVBState_open_local_document
|
runtime error: null pointer passed as argument 2, which is declared to never be null
|
|
#0 0x7ffff7b5f30a in encode_root couchstore/src/node_types.cc:75
|
#1 0x7ffff7b36033 in db_write_header couchstore/src/couch_db.cc:175
|
#2 0x7ffff7b3f487 in couchstore_commit couchstore/src/couch_db.cc:255
|
#3 0x12c0e6d in CouchKVStore::rollback(unsigned short, unsigned long, std::shared_ptr<RollbackCB>) kv_engine/engines/ep/src/couch-kvstore/couch-kvstore.cc:2674
|
#4 0xd15cc6 in CouchKVStoreErrorInjectionTest_readVBState_open_local_document_Test::TestBody() kv_engine/engines/ep/tests/module_tests/kvstore_test.cc:1030
|