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

Client lock must protect OperationContext's LockState pointer

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.3.1
    • Affects Version/s: None
    • Component/s: Internal Code
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Execution Team 2019-11-04
    • 56

      The GlobalLockServerStatusSection assumes that it can lock a Client's mutex and then call this function on that Client:
      clientOpCtx->lockState()->getClientState()

      However, we routinely swap out or change the lock state pointer in an OperationContext without locking the mutex. This can cause the server status section code to hit a null pointer, or read freed memory. The fix should be to ensure that the Client mutex is locked before touching an OperationContext's _locker member. Currently, there are two member functions that do this: setLockState() and swapLockState().

            Assignee:
            milkie@mongodb.com Eric Milkie
            Reporter:
            milkie@mongodb.com Eric Milkie
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: