[SERVER-55013] Improvement lifetime management in PooledLDAPConnection::runFuncWithTimeout Created: 05/Mar/21  Updated: 29/Oct/23  Resolved: 10/Mar/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.9.0, 4.4.5

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

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4
Sprint: Security 2021-03-22
Participants:
Case:

 Description   

There is a lifetime management issue in PooledLDAPConnection::runFuncWithTimeout, seeĀ https://github.com/10gen/mongo-enterprise-modules/blob/master/src/ldap/connections/ldap_connection_factory.cpp#L221-L261. In this function, we access this but we do nothing to guarantee that this is alive when it is used. In the stack below, we see a call to a lambda in WrappedConnection::query::lambda but I could not find any stack in the process with a matching stack containing WrappedConnection::query. This implies that the query() call timed out and the connection was likely reaped why it was still being used.



 Comments   
Comment by Githook User [ 10/Mar/21 ]

Author:

{'name': 'Mark Benvenuto', 'email': 'mark.benvenuto@mongodb.com', 'username': 'markbenvenuto'}

Message: SERVER-55013 Improvement lifetime management in PooledLDAPConnection::runFuncWithTimeout

(cherry picked from commit 6fdb08360cb89235a75ef26b564168fadf2c1023)
Branch: v4.4
https://github.com/10gen/mongo-enterprise-modules/commit/f5c7000628dcadc87cf51118917440caa42dc1d8

Comment by Githook User [ 10/Mar/21 ]

Author:

{'name': 'Mark Benvenuto', 'email': 'mark.benvenuto@mongodb.com', 'username': 'markbenvenuto'}

Message: SERVER-55013 Improvement lifetime management in PooledLDAPConnection::runFuncWithTimeout
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/6fdb08360cb89235a75ef26b564168fadf2c1023

Generated at Thu Feb 08 05:35:12 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.