[SERVER-49947] Catalog Cache async task accesses un-owned StringData variable Created: 28/Jul/20 Updated: 29/Oct/23 Resolved: 29/Jul/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | 4.5.1 |
| Fix Version/s: | 4.7.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Tommaso Tocci | Assignee: | Tommaso Tocci |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | PM-1645-Milestone-2 | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Operating System: | ALL | ||||||||||||
| Sprint: | Sharding 2020-08-10 | ||||||||||||
| Participants: | |||||||||||||
| Linked BF Score: | 43 | ||||||||||||
| Description |
|
Cache loader access un-owned variable causing use-after-free memory access error. StringData object wraps a 'const std::string&' or a 'const char*' without copying its contents. Thus keeping alive the StringData object itself doesn't guarantee that the underlying char array won't be freed. For this reason when capturing such an object in an async task an explicit copy of the underlying data needs to be performed. |
| Comments |
| Comment by Githook User [ 29/Jul/20 ] |
|
Author: {'name': 'Tommaso Tocci', 'email': 'tommaso.tocci@mongodb.com', 'username': 'toto-dev'}Message: |