[SERVER-50818] Coverity analysis defect 114987: Wrapper object use after free Created: 09/Sep/20  Updated: 29/Oct/23  Resolved: 18/Sep/20

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.8.0, 4.4.2, 4.2.11, 4.0.21, 3.6.21

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Arun Banala
Resolution: Fixed Votes: 0
Labels: coverity, coverity-pm-1854-tracking, greenerbuild, qexec-team
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
is related to SERVER-49363 Triage Coverity Issues for Query code... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4, v4.2, v4.0, v3.6
Participants:

 Description   

Wrapper object use after free

A use after free bug would occur if the internal pointer is used. An internal pointer of a wrapper object remains available after the object is freed
/src/mongo/db/pipeline/document_source_list_local_sessions.cpp:46: WRAPPER_ESCAPE 114987 Calling "back" which extracts wrapped state from "this->_ids".
/src/mongo/db/pipeline/document_source_list_local_sessions.cpp:46: WRAPPER_ESCAPE 114987 Assigning: "id" = "this->_ids.back()".
/src/mongo/db/pipeline/document_source_list_local_sessions.cpp:47: WRAPPER_ESCAPE 114987 Calling "pop_back" invalidates the internal representation of "this->_ids".
/src/mongo/db/pipeline/document_source_list_local_sessions.cpp:49: WRAPPER_ESCAPE 114987 Using invalidated internal representation of "this->_ids".



 Comments   
Comment by Githook User [ 05/Oct/20 ]

Author:

{'name': 'Arun Banala', 'email': 'arun.banala@mongodb.com', 'username': 'banarun'}

Message: SERVER-50818 Coverity analysis defect 114987: Wrapper object use after free

(cherry picked from commit 0349776028d92914c0502d6419c5e73306b7a170)
Branch: v3.6
https://github.com/mongodb/mongo/commit/507a73bdef9a4d6f81ab74d428a3076fbcf28fe5

Comment by Githook User [ 05/Oct/20 ]

Author:

{'name': 'Arun Banala', 'email': 'arun.banala@mongodb.com', 'username': 'banarun'}

Message: SERVER-50818 Coverity analysis defect 114987: Wrapper object use after free

(cherry picked from commit 0349776028d92914c0502d6419c5e73306b7a170)
Branch: v4.2
https://github.com/mongodb/mongo/commit/2098f60658d9d8d6dc7560b7a8047ac6416a1481

Comment by Githook User [ 05/Oct/20 ]

Author:

{'name': 'Arun Banala', 'email': 'arun.banala@mongodb.com', 'username': 'banarun'}

Message: SERVER-50818 Coverity analysis defect 114987: Wrapper object use after free

(cherry picked from commit 0349776028d92914c0502d6419c5e73306b7a170)
Branch: v4.0
https://github.com/mongodb/mongo/commit/92154af191d67409ab3cf3e0147e7299c63e1216

Comment by Githook User [ 05/Oct/20 ]

Author:

{'name': 'Arun Banala', 'email': 'arun.banala@mongodb.com', 'username': 'banarun'}

Message: SERVER-50818 Coverity analysis defect 114987: Wrapper object use after free

(cherry picked from commit 0349776028d92914c0502d6419c5e73306b7a170)
Branch: v4.4
https://github.com/mongodb/mongo/commit/e80248d4aea5192d895760e5296ddb46238bef37

Comment by Githook User [ 18/Sep/20 ]

Author:

{'name': 'Arun Banala', 'email': 'arun.banala@mongodb.com', 'username': 'banarun'}

Message: SERVER-50818 Coverity analysis defect 114987: Wrapper object use after free
Branch: master
https://github.com/mongodb/mongo/commit/0349776028d92914c0502d6419c5e73306b7a170

Generated at Thu Feb 08 05:23:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.