[SERVER-64859] CSFLE: Crash on exit when mongo_csfle_v1_lib instance still alive Created: 24/Mar/22 Updated: 29/Oct/23 Resolved: 31/Mar/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Field Level Encryption |
| Affects Version/s: | 5.3.0-rc4 |
| Fix Version/s: | 6.0.0-rc0 |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Anna Henningsen | Assignee: | Sergey Galtsev (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | csfle | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Linux (ubuntu2004 and rhel80), possibly others. Affects at least 5.3.0-rc4 and mongo_csfle_v1-6.0.0-alpha-763-g89c2fbc (current master). |
||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Backport Requested: |
v5.3
|
||||||||
| Steps To Reproduce: | The following steps will (at least on Linux) lead to a crash:
Small repro program (with attached valgrind output): https://gist.github.com/addaleax/993e80036cf54231f7d65a037e818de6 |
||||||||
| Sprint: | Security 2022-04-04 | ||||||||
| Participants: | |||||||||
| Description |
|
The CSFLE shared library runs into the flipside of the static initialization order fiasco when it is active (i.e. a mongo_csfle_v1_lib exists) while the process shuts down. In particular, this line: leads to a call to mongo::runGlobalDeinitializers(), which fails because the global singleton ConstructorActionList has already been destroyed, and consequently to memory corruption which crashes the process with SIGABRT/SIGSEGV. |
| Comments |
| Comment by Githook User [ 31/Mar/22 ] |
|
Author: {'name': 'sergey.galtsev', 'email': 'sergey.galtsev@mongodb.com', 'username': 'brushless-glitch'}Message: |
| Comment by Sergey Galtsev (Inactive) [ 30/Mar/22 ] |
| Comment by Anna Henningsen [ 24/Mar/22 ] |
|
ana.meza jacob.evans Not sure about urgency, but I’m pretty sure it would be a blocker for using the CSFLE library in most environments. |
| Comment by Ana Meza [ 24/Mar/22 ] |
|
Hi jacob.evans could you please review this one as it seems urgent |