[SERVER-71589] Coverity analysis defect 134193: Freed internal location read Created: 23/Nov/22  Updated: 29/Oct/23  Resolved: 02/Jun/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Randolph Tan
Resolution: Fixed Votes: 0
Labels: coverity, new-eng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

Freed internal location read

Reading from freed memory can cause wrong values to be read and crashes due to illegal memory accesses. Reads target of a freed internal pointer
/src/mongo/db/s/global_index/global_index_cloning_service.cpp:430: WRAPPER_ESCAPE 134193 Calling "front" which extracts wrapped state from "this->this->_fetchedDocs".
/src/mongo/db/s/global_index/global_index_cloning_service.cpp:430: WRAPPER_ESCAPE 134193 Assigning: "next" = "this->this->_fetchedDocs.front()".
/src/mongo/db/s/global_index/global_index_cloning_service.cpp:439: WRAPPER_ESCAPE 134193 Calling "pop" invalidates the internal representation of "this->this->_fetchedDocs".
/src/mongo/db/s/global_index/global_index_cloning_service.cpp:441: WRAPPER_ESCAPE 134193 Using invalidated internal representation of "this->this->_fetchedDocs".



 Comments   
Comment by Githook User [ 02/Jun/23 ]

Author:

{'name': 'Randolph Tan', 'email': 'randolph@10gen.com', 'username': 'renctan'}

Message: SERVER-71589 Don't pop _fetchedDocs while reference to its items is being used in GlobalIndexCloningService::_processBatch
Branch: master
https://github.com/mongodb/mongo/commit/7d5923a76c0362e10b18f0919b998b79812d03c9

Generated at Thu Feb 08 06:19:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.