[SERVER-83161] Fix concurrent read to `_errMsg` from `MigrationDestinationManager` without acquiring mutex Created: 13/Nov/23  Updated: 23/Nov/23  Resolved: 22/Nov/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 4.4.25, 5.0.22, 6.0.11, 7.0.3, 7.2.0-rc1
Fix Version/s: 7.3.0-rc0, 7.2.0-rc2, 4.4.27, 7.0.5, 6.0.13, 5.0.24

Type: Bug Priority: Major - P3
Reporter: Pol Pinol Assignee: Aitor Esteve Alvarado
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v7.2, v7.0, v6.0, v5.0, v4.4
Sprint: CAR Team 2023-11-27
Participants:
Linked BF Score: 104

 Description   

An unprotected read access of the variable _errMsg from MigrationDestinationManager at the destructor of MoveTimingHelper, can be concurrent with write accesses, e.g. MigrationDestinationManager::_setStateFail or MigrationDestinationManager::_setStateFailWarn

An implementation idea is to create a copy of the _errMsg protected by the mutex when instantiating a MoveTimingHelper, and not passing an unprotected pointer.



 Comments   
Comment by Githook User [ 23/Nov/23 ]

Author:

{'name': 'Aitor Esteve Alvarado', 'email': 'aitor.esteve@mongodb.com', 'username': 'atesteve'}

Message: SERVER-83161 Fix concurrent read to _errMsg from MigrationDestinationManager without acquiring mutex

(cherry picked from commit a082c2a1393c160d277d62683898ed9fe6dd13fc)

GitOrigin-RevId: 39f44bf5d9a88883b0d099e5f3fc98df0d5b1a1f
Branch: v4.4
https://github.com/mongodb/mongo/commit/da389fd125f37bbfeea3f64f708b79915a858271

Comment by Githook User [ 23/Nov/23 ]

Author:

{'name': 'Aitor Esteve Alvarado', 'email': 'aitor.esteve@mongodb.com', 'username': 'atesteve'}

Message: SERVER-83161 Fix concurrent read to _errMsg from MigrationDestinationManager without acquiring mutex

(cherry picked from commit a082c2a1393c160d277d62683898ed9fe6dd13fc)
Branch: v6.0
https://github.com/mongodb/mongo/commit/20d085bec46c7af3c08d5879adc04cd65fcd6c38

Comment by Githook User [ 23/Nov/23 ]

Author:

{'name': 'Aitor Esteve Alvarado', 'email': 'aitor.esteve@mongodb.com', 'username': 'atesteve'}

Message: SERVER-83161 Fix concurrent read to _errMsg from MigrationDestinationManager without acquiring mutex

(cherry picked from commit a082c2a1393c160d277d62683898ed9fe6dd13fc)
Branch: v7.0
https://github.com/mongodb/mongo/commit/95cd26aa074d5ec0092e9efd55a3386cad325ee6

Comment by Githook User [ 23/Nov/23 ]

Author:

{'name': 'Aitor Esteve Alvarado', 'email': 'aitor.esteve@mongodb.com', 'username': 'atesteve'}

Message: SERVER-83161 Fix concurrent read to _errMsg from MigrationDestinationManager without acquiring mutex

(cherry picked from commit a082c2a1393c160d277d62683898ed9fe6dd13fc)
Branch: v5.0
https://github.com/mongodb/mongo/commit/a8412612c928f52229df48b272dbee9b89fab090

Comment by Githook User [ 22/Nov/23 ]

Author:

{'name': 'Aitor Esteve Alvarado', 'email': 'aitor.esteve@mongodb.com', 'username': 'atesteve'}

Message: SERVER-83161 Fix concurrent read to _errMsg from MigrationDestinationManager without acquiring mutex

(cherry picked from commit a082c2a1393c160d277d62683898ed9fe6dd13fc)
Branch: v7.2
https://github.com/mongodb/mongo/commit/6d12bf7945ce5e49457799c8b68f40e0321efa17

Comment by Githook User [ 22/Nov/23 ]

Author:

{'name': 'Aitor Esteve Alvarado', 'email': 'aitor.esteve@mongodb.com', 'username': 'atesteve'}

Message: SERVER-83161 Fix concurrent read to _errMsg from MigrationDestinationManager without acquiring mutex
Branch: master
https://github.com/mongodb/mongo/commit/a082c2a1393c160d277d62683898ed9fe6dd13fc

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