[SERVER-60451] Index builds code can access an invalid BSONObj because the cursor was saved&restored at a lower level Created: 04/Oct/21 Updated: 29/Oct/23 Resolved: 05/Oct/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 5.2.0, 5.0.4, 5.1.0-rc0 |
| Type: | Bug | Priority: | Blocker - P1 |
| Reporter: | Dianna Hohensee (Inactive) | Assignee: | Dianna Hohensee (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||
| Operating System: | ALL | ||||||||||||||||
| Backport Requested: |
v5.1, v5.0
|
||||||||||||||||
| Sprint: | Execution Team 2021-10-18 | ||||||||||||||||
| Participants: | |||||||||||||||||
| Linked BF Score: | 118 | ||||||||||||||||
| Description |
|
This objToIndex BSONObj is pointing to a cursor, which can be saved/restored and no longer save the data to which objToIndex points. Save/restore was exercised further down the stack, because we were running a createIndex command on two indexes at once, so this loop further down the stack with a reference to objToIndex can hit a WCE, save/restore the cursor, and then keep trying to use the now invalid objToIndex/doc BSONObj for the second index. Recommendations: call getOwned() to assign a copy in objToIndex; or, update the objToIndex reference in the same lambda that restores the cursor. |
| Comments |
| Comment by Githook User [ 07/Oct/21 ] |
|
Author: {'name': 'Dianna Hohensee', 'email': 'dianna.hohensee@mongodb.com', 'username': 'DiannaHohensee'}Message: (cherry picked from commit 0300f19cd738e58cdeaa88b7406a2f38718b0ad9) |
| Comment by Githook User [ 05/Oct/21 ] |
|
Author: {'name': 'Dianna Hohensee', 'email': 'dianna.hohensee@mongodb.com', 'username': 'DiannaHohensee'}Message: (cherry picked from commit 0300f19cd738e58cdeaa88b7406a2f38718b0ad9) |
| Comment by Githook User [ 05/Oct/21 ] |
|
Author: {'name': 'Dianna Hohensee', 'email': 'dianna.hohensee@mongodb.com', 'username': 'DiannaHohensee'}Message: |