[SERVER-64427] Init-order fiasco in secure_allocator Created: 10/Mar/22  Updated: 29/Oct/23  Resolved: 11/Mar/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.0.0-rc0

Type: Bug 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:
Depends
Problem/Incident
is caused by SERVER-63645 shell - support FLE 2 client-side tra... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Service Arch 2022-03-21
Participants:
Linked BF Score: 167
Story Points: 1

 Description   

Init-order fiasco in secure_allocator.

It accesses a namespace scope hash table to construct namespace scope objects.

These are the newly changed:

FLEIndexKey indexKey(KeyMaterial(indexVec.begin(), indexVec.end()));

in this case (SERVER-63645). It is just a symptom though.

This is not going to work unless the link order accidentally makes it work.

https://evergreen.mongodb.com/task/mongodb_mongo_master_ubuntu1804_debug_aubsan_lite_required_run_unittests_c0652d91db0fb5cc54f12811e100ec8108130112_22_03_10_19_19_03

Affecting ASAN in mongodb-mongo-master waterfall.

The secure allocator has to be ALWAYS available, including for the initialization of global static duration objects and must be alive during their destruction.

Hide all such instances behind local static immortals.



 Comments   
Comment by Githook User [ 11/Mar/22 ]

Author:

{'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}

Message: SERVER-64427 init-order fiasco in SecureAllocator
Branch: master
https://github.com/mongodb/mongo/commit/a00fb5cf43aa8ed985998bc634d8c9afdf5c74a3

Comment by Billy Donahue [ 10/Mar/22 ]

This is a very quick fix. Pulling it into sprint.

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