[SERVER-79138] Fix data race in AuthorizationSessionTest fixture Created: 19/Jul/23  Updated: 18/Jan/24  Resolved: 09/Aug/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 7.0.0, 7.1.0-rc0
Fix Version/s: 7.1.0-rc0, 7.0.1

Type: Bug Priority: Major - P3
Reporter: Erwin Pe Assignee: Erwin Pe
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Related
related to SERVER-85377 Fix data race in AuthorizationSession... Closed
Assigned Teams:
Server Security
Backwards Compatibility: Fully Compatible
Backport Requested:
v7.0
Sprint: Security 2023-08-07, Security 2023-08-21
Participants:
Linked BF Score: 20

 Description   

When the `setUp()` method of AuthorizationSessionTest replaces the existing AuthorizationManager attached to the global ServiceContext with another AuthorizationManager instance, it causes a race with the JournalFlusher thread, which gets started earlier (in the ServiceContextMongoDTest constructor) and tries to acquire a pointer to the current global AuthorizationManager.

One fix is to ensure that we perform the replacement of the AuthorizationManager, before the JournalFlusher (or any other thread that creates a authorization session) is started.



 Comments   
Comment by Githook User [ 21/Aug/23 ]

Author:

{'name': 'Erwin Pe', 'email': 'erwin.pe@mongodb.com', 'username': 'erwee'}

Message: SERVER-79138 Fix data race in AuthorizationSessionTest fixture

(cherry picked from commit 9eb4fbf166ba9ae6cec9876940f3813a99546379)
Branch: v7.0
https://github.com/mongodb/mongo/commit/e6c77cb459246931b1800a56089ddfda2449f9a8

Comment by Githook User [ 09/Aug/23 ]

Author:

{'name': 'Erwin Pe', 'email': 'erwin.pe@mongodb.com', 'username': 'erwee'}

Message: SERVER-79138 Fix data race in AuthorizationSessionTest fixture
Branch: master
https://github.com/mongodb/mongo/commit/9eb4fbf166ba9ae6cec9876940f3813a99546379

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