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

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.4.0-rc5, 4.7.0
    • Affects Version/s: None
    • Component/s: Storage
    • None
    • Fully Compatible
    • ALL
    • v4.4
    • Execution Team 2020-05-18
    • 88

      _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.

            Assignee:
            milkie@mongodb.com Eric Milkie
            Reporter:
            dianna.hohensee@mongodb.com Dianna Hohensee (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: