#50637 Ticket 50636 - Crash during sasl bind
Merged 2 months ago by tbordaz. Opened 2 months ago by tbordaz.
tbordaz/389-ds-base ticket_50636  into  master

@@ -1576,12 +1576,15 @@ 

                       */

                      pb_conn->c_anonlimits_set = 1;

                  }

-                 pthread_mutex_unlock(&(pb_conn->c_mutex));

  

+                 /* must hold c_mutex so that it synchronizes the IO layer push

+                  * with a potential pending sasl bind that is registering the IO layer

+                  */

                  if (connection_call_io_layer_callbacks(pb_conn)) {

                      slapi_log_err(SLAPI_LOG_ERR, "connection_threadmain",

                                    "Could not add/remove IO layers from connection\n");

                  }

+                 pthread_mutex_unlock(&(pb_conn->c_mutex));

                  break;

              default:

                  break;

Bug Description:
Sasl bind registers IO layers (sasl_IoMethods) that will be
pushed (and called) by the next incoming operation.
So the next incoming operation should synchronize itself
with the sasl bind.

Fix Description:
The call to connection_call_io_layer_callbacks, that pushes
registered methods, must hold c_mutex so that it let
a pending sasl bind to fully register the methods.

https://pagure.io/389-ds-base/issue/50636

Reviewed by: Ludwig Krispenz

Platforms tested: F28

Flag Day: no

Doc impact: no

rebased onto 52f2b0d

2 months ago

Pull-Request has been merged by tbordaz

2 months ago
Metadata