[SERVER-62207] ReshardCollection with small maxTimeMS can crash the shard due to incorrect BSON object lifetime Created: 21/Dec/21 Updated: 29/Oct/23 Resolved: 28/Dec/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | 5.0.0, 5.2.0, 5.1.0 |
| Fix Version/s: | 5.3.0, 5.0.6, 5.2.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jordi Serra Torrens | Assignee: | Jordi Serra Torrens |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||
| Issue Links: |
|
||||
| Backwards Compatibility: | Fully Compatible | ||||
| Operating System: | ALL | ||||
| Backport Requested: |
v5.2, v5.0
|
||||
| Steps To Reproduce: |
|
||||
| Sprint: | Sharding EMEA 2021-12-27 | ||||
| Participants: | |||||
| Description |
|
_shardsvrReshardCollection constructs a ReshardCollectionCoordinator passing as argument 'request()', which contains non-owned BSON objects (in particular, 'key' and 'collation'. ReshardCollectionCoordinator makes a copy of the ShardsvrReshardCollection object, but the mentioned BSON objects are still unowned. Thus, if ReshardCollectionCoordinator outlives the _shardsvrReshardCollection command, a crash can happen because the underlying bson objects are dangling. |
| Comments |
| Comment by Githook User [ 20/Jan/22 ] |
|
Author: {'name': 'Jordi Serra Torrens', 'email': 'jordi.serra-torrens@mongodb.com', 'username': 'jordist'}Message: (cherry picked from commit 5eab3ca8acaa0e8004c50112187b6809667157a2) |
| Comment by Githook User [ 29/Dec/21 ] |
|
Author: {'name': 'Jordi Serra Torrens', 'email': 'jordi.serra-torrens@mongodb.com', 'username': 'jordist'}Message: (cherry picked from commit 5eab3ca8acaa0e8004c50112187b6809667157a2) |
| Comment by Githook User [ 28/Dec/21 ] |
|
Author: {'name': 'Jordi Serra Torrens', 'email': 'jordi.serra-torrens@mongodb.com', 'username': 'jordist'}Message: |