[SERVER-43880] renameCollection across DBs uses unowned RecordData after cursor has been yielded Created: 08/Oct/19  Updated: 29/Oct/23  Resolved: 07/Nov/19

Status: Closed
Project: Core Server
Component/s: Catalog
Affects Version/s: 4.2.0
Fix Version/s: 4.3.1, 4.2.2

Type: Bug Priority: Major - P3
Reporter: Louis Williams Assignee: Eric Milkie
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.2
Sprint: Execution Team 2019-11-04, Execution Team 2019-11-18
Participants:

 Description   

renameBetweenDBs calls cursor->next() and keeps track of an unowned RecordData. After it saves, commits, and restores, it attempts to insert the RecordData it was holding in a prior snapshot.

This is problematic because the RecordData can point to freed or overwritten memory.



 Comments   
Comment by Githook User [ 25/Nov/19 ]

Author:

{'email': 'milkie@mongodb.com', 'name': 'Eric Milkie', 'username': 'milkie'}

Message: SERVER-43880 renameBetweenDBs needs to own record data prior to yielding

(cherry picked from commit a811bbe9d2489c428886288651c2dbddec0d123d)
Branch: v4.2
https://github.com/mongodb/mongo/commit/bf17247e9dfa28b315d6b2c04da0d202ebba8d97

Comment by Githook User [ 07/Nov/19 ]

Author:

{'username': 'milkie', 'email': 'milkie@mongodb.com', 'name': 'Eric Milkie'}

Message: SERVER-43880 renameBetweenDBs needs to own record data prior to yielding
Branch: master
https://github.com/mongodb/mongo/commit/a811bbe9d2489c428886288651c2dbddec0d123d

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