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

CollMod (_collModInternal) unsafely accesses an IndexCatalogEntry that is destructed in an onRollback handler

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.4.0-rc5, 4.7.0
    • Component/s: Storage
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v4.4
    • Sprint:
      Execution Team 2020-05-18
    • Linked BF Score:
      88

      Description

      _collModInternal has a cmrNew variable that is used in a writeConflictRetry loop, but initialized before the loop begins. Usage of cmrNew must be very careful not to access memory that can become invalid (freed) after an onRollback call caused by a WriteConflictException. After SERVER-9306, we try to access cmrNew.idx (the unsafe pointer) before initializing it again in the writeConflictRetry loop. The old code, prior to SERVER-9306, did not make this mistake: the access used to be after initializing the pointer, so the pointer was safe for use at that point.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              milkie Eric Milkie
              Reporter:
              dianna.hohensee Dianna Hohensee
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: