Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-42455

ReplicaSetChangeNotifier::onConfirmedSet is unsafe during shutdown

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Linked BF Score:
      0

      Description

      The replica set change notifier makes a copy of _listeners under a lock, but then invokes onConfirmedSet on those listeners outside the lock. During shutdown, those pointers can be dead, which can cause us to use after free and crash.

      See replica_set_change_notifier.cpp#L116-L120

          auto listeners = _listeners;
          lk.unlock();
       
          for (auto listener : listeners) {
              listener->onConfirmedSet(state);
          };
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: