[SERVER-79328] Decorable refactor UBSAN fix: pass void* for backlinks Created: 25/Jul/23 Updated: 29/Oct/23 Resolved: 27/Jul/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 7.1.0-rc0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Billy Donahue | Assignee: | Billy Donahue |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Sprint: | Service Arch 2023-08-07 | ||||||||
| Participants: | |||||||||
| Linked BF Score: | 162 | ||||||||
| Description |
|
We're downcasting a "this" pointer to its CRTP descendent in its CRTP base constructor, and the object is not yet an instance of that CRTP descendent, so this is incorrect. The backlink pointer is all reinterpret casts and lowlevel memory hacking anyway, so we can just pass a void* for this purpose and UBSAN has nothing to complain about. The downcast isn't needed until decoration.owner is called, which should be after the owner is constructed, and the downcast will be valid. |
| Comments |
| Comment by Githook User [ 27/Jul/23 ] |
|
Author: {'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}Message: |